How to find all GameObjects in Hierarchy by name and put them in an Array[] ? (C#)

I’m trying to make an Array of GameObjects of a Specific Name, How do I find them by Name then put them in an Array?

thanks in advance.

I only found unswers in java.

you can not find all the objects called the same, but you can give a tag to all those gameobjects and use this line of code, just remmember to tag them the same

GameObject[] yourArray = GameObject.FindGameObjectsWithTag("Tag");