I have something like this:
string[] split = ListOfUsers.Split(new Char[] { ';', ',', ' ' });
Each string in “split” has an “@” sign at the beginning, and I want to get rid of it. What would be the ideal way to get the substring of this array, without getting into a for loop. Can I use Linq instead?
Thanks for looking 🙂
There is an overload of
String.Trimthat does exactly this: removes the specified characters from the beginning and end of a string:If your strings contain multiple
@s in the beginning or end with a@this will do more than you intended. In that case, you can also simply useString.Substring: