How can I find out how many of an object are in the array?

public class move : MonoBehaviour
{

  public GameObject lefthand;
  public Transform[] lchilds;
  public int lcount;

    private void Update()
  {       
        lchilds = new Transform[lefthand.transform.childCount];
        lcount = lefthand.transform.childCount;
        for (int i = 0; i < lefthand.transform.childCount; i++)
        {          
            lchilds *= lefthand.transform.GetChild(i);* 

}
Transform llastchild = lchilds[lchilds.Length-1];
}
}
I define a array and objects are added to this array throughout the game. The added objects are of 3 types. 3 kinds of objects named A, B and C are added. I want to find out how many “A”, how many “B”, how many “C” there are in the series. Is there a way to do this?

You could use LINQ.

totalA = lchilds.Count(x => x.name == "A");
totalB = lchilds.Count(x => x.name == "B");
totalC = lchilds.Count(x => x.name == "C");

You could probably use a foreach statement.

int A = 0;
int B = 0;
int C = 0;

private void CalculateObjects()
{
    foreach(Transform t in lchilds)
    {
        if (t == /*Object A*/) A++;
        if (t == /*Object B*/) B++;
        if (t == /*Object C*/) C++;
    }
}

NOTE Do not put this in Update() because then the integers will just keep going up.

NameOfArray.Length its that simple