C# TrimEnd Function in ASP.Net

C# String TrimEnd function removes the unwanted characters from the trailing positions of the string. You can pass the C# Char array collection of characters that you want to remove from the ending indexes of the specified string text. You must specify all the possible characters in the char array that may occur at the trailing indexes of the string. If you will omit the unwanted character that is at the last index of the specified string then TrimStart function will not remove any of them. If you will omit the special character in the char array that is at the second last index of the specified string then it will trim only last place character. You can learn the functionality of C# TrimEnd function with help of following sample very easily:

Enter String:
Enter Special Chars:
[Please enter each special character in new new line by pressing enter.]
Output: