C# Programming
01-19-2010, 03:21 AM
Hi All,
say i have these inputs strings:
string input_1 = " ABCD ";
string input_2 = " A BC D ";
string input_3 " A B C D ";
I want to convert these strings to the follows:
input_1 = " ABCD";
input_2 = " A BC D";
input_3 " A B C D";
basically remove all the blanks after the last letter, i know the string.TrimEnd() function in .Net can be used to achieve my requirement. Is there another way (without using string.TrimEnd() function) to achieve the same as String.TrimEnd() does?
Many thanks
say i have these inputs strings:
string input_1 = " ABCD ";
string input_2 = " A BC D ";
string input_3 " A B C D ";
I want to convert these strings to the follows:
input_1 = " ABCD";
input_2 = " A BC D";
input_3 " A B C D";
basically remove all the blanks after the last letter, i know the string.TrimEnd() function in .Net can be used to achieve my requirement. Is there another way (without using string.TrimEnd() function) to achieve the same as String.TrimEnd() does?
Many thanks