C#StringTrimEnd

Removes all trailing whitespace characters.

Syntax

str.TrimEnd()

Example

Enter values below to update the example in real time.

string
Console
WriteLine
TrimEnd
string text = "  hello world  ";
Console.WriteLine(text.TrimEnd());   // "  hello world"