C# Has pretty neat String trimming methods.
I'm listing different options below. Although, the one you are looking for is
"This string ends here. ".TrimEnd(); //This also works.
string message = " Hello! ";
message.TrimEnd(); // Trims from the right side.
message.TrimStart(); // Trims from the left side.
message.Trim(); // Trims on both sides
message.TrimEnd() will trim from the right side of the string variable.
message.TrimStart() will trim from the left side of the string variable.
message.Trim() will trim from both sides of the string variable.
Also msdn provides code for rtrim in visual basic, which does not help.
I found a few that might help you, and they have them in multiple .NET languages, including C#.
Microsoft - String.Trim Method
Microsoft - String.TrimEnd Method
Microsoft - String.TrimStart Method
Hope this helps you :)