I have string like this:
string something = "12+3-1";
something.hereIwantToRemoveFirstElement();
Console.WriteLine(something); // i want to get "2+3-1"
Is it possible? Or maybe I should do like that to remove char from string, like it is in List?
something.RemoveAt(2);
Console.WriteLine(something);// i want to get "123-1"
Or maybe there is easy way to convert entire string to list, and then remove specific element?
something.ToList().
something.RemoveAt(0);// i want to get "2+3-1"
Can you please tell me how to do it efficiently?
string, and you use the already provided methodRemoveAt, what is the issue?something.Substring(1)will remove the first element. If you want to convert it to a list,something.ToList()will do it, thenstring.Concat(something)to turn it back into a stringString.RemoveAt()ToListis a part of theSystem.Linqnamespace, so just add ausingdeclaration for that. Although I will say that would be an odd approach for such a simple string operation. Just use one of the built-in methods. Keep in mind that it's always a good idea to look through the docs to get an understanding of what these methods do and examples of proper usage.