I have a problem with a String. The string is like this:
string something = " whatever and something else ";
Now I'm trying to get rid of the spaces at the beginning and at the end like this:
something = something.Trim();
But that didn't work, I also tried this:
something = something.TrimStart();
something = something.TrimEnd();
And this:
something = something.TrimStart(' ');
something = something.TrimEnd(' ');
And this:
int lineLength = line.Length;
string LastCharacter = line.Remove(lineLength - 1);
while (LastCharacter == " ")
{
line = line.Remove(lineLength - 1);
lineLength = line.Length;
LastCharacter = line.Remove(lineLength - 1);
}
The String is Out of a RichTextBox.
Now I think it could be a problem with the Text formatting or something (I'm in Germany).
Thank you in advance, tietze111