How should i destroy gameobjects by their name?

Hello again,
Since from my last question, with your help i managed to delete all of my instances with one click! That’s great! Now i would like to develop something more on to this. So here is what i would like to do; naming each ten copies of clones as clone1, clone2, clone3 etc and deleting these ten copies of clones in order to their names so first clone3 will be deleted then clone2 and clone1 etc. I managed to do it by using tags and searching for the tags and destroying them but this seemed really long to me. So is there any alternative that you could possibly suggest? Thank you in advance and here is the script that i’ve written.(Excuse me for my english and grammar since i am a foreigner)

#pragma strict
var Reference : GameObject;
private var Clones : Array = new Array();

function Start ()
{

}

function Update ()
{
	if(Input.GetKeyDown(KeyCode.C))//C stands for creating 10 clones of reference
	{
		for(var i : int = 0; i < 10; ++i)
		{
			var Clone : GameObject;
			Clone = Instantiate(Reference, Reference.transform.position, Reference.transform.rotation);
			Clone.name = "Clone";
			Clones.Push(Clone);
		}
	}
	if(Input.GetKeyDown(KeyCode.D))//D stands for deleting clones from the scene
	{
		for(var j : GameObject in Clones)
		{
			Destroy(j);
		}
	Clones.Clear();
	}
}

Use the Tag system. Simple add a tag to the prefab and any clones that come from that prefab with the correct tag, destroy those.

Here’s a very simple approach:
Add a tag to all the objects you want to destroy by code:

//After your Instantiate:

Clone.tag = “TagName”;

And then you can get all the objects of tag “TagName” and destroy them:

void Start () {
		 
	foreach(GameObject g in GameObject.FindGameObjectsWithTag("TagName")){
			Destroy(g);
	}

}

// GameObject.Find(“FindByNameHere”);

var c1 : GameObject;

function Start() { c1 = GameObject.Find("clone1"); }

function Update() {  Destroy(c1); }

Hi,

Update your GetKeyDown code with this…

if(Input.GetKeyDown(KeyCode.D))//D stands for deleting clones from the scene
     {
     	var newTempList : Array = new Array();
        for(var j : GameObject in Clones)
        {
         	if(j.name.Contains("" + n))
            {
            	newTempList.Add(j);
            	Destroy(j);
            }
       	}
     		
     	for(var k : GameObject in newTempList)
        {
         	Clones.Remove(k);
        }
        if(n == 0)
     		Clones.Clear();
   		
     	n--;
     	
     	Debug.Log(Clones.length);
     }