Hello all
I am currently trying to display the name of my objects in game, but due to a external reason they have come up with numbers on the end and there a lot of these objects. example name : (item [0001])
To handle this I thought I could remove this data from the string but am struggling on how to do this, after trying around with strings I have manged to extract the number, I just need to remove it from the string my code as bellow:
string id = clickedObject.name;
int firstBracket = id.IndexOf("[")+1;
int lastBracket = id.IndexOf("]");
int difference = lastBracket - firstBracket;
Im just sruggling how to remove the difference from the id.