I'm trying to get all characters in a string that occur before a certain character.
For example:
string id = "Hello everyone! Good day today.";
id = id.Remove(id.IndexOf('!'));
Console.WriteLine(id);
//output will be "Hello everyone"
And this works, but when I'm reading text from a special file and working with strings that contain special characters, I run into some trouble.
For example:
string id = "Hello everybodyø1Ø9ß&ëÄ"
If I wanted to only get the "Hello everybody" text, how would I do that? These special characters can be anything.