Normally I'd use
MyObject Obj1 = new MyObject(constructors);
string objectname = HakunaMatata
MyObject [I want HakunaMatata here] = new MyObject;
objectname = SomethingNew
MyObject [I want SomethingNew here] = new MyObject;
You're looking for a
Dictionary<TKey,TValue>. This enables you to use a string as the "key" and have instances as the value.
string objectname = "HakunaMatata" var myDictionary = new Dictionary<string,MyObject>(); myDictionary.Add(objectname, new MyObject()); // what a wonderful day!
you can later lookup & use your object by using the same key
MyObject makunaMatataInstance = myDictionary["HakunaMatata"]; // or use the variable "objectname" again