string useOfTrimEnd1= "Hello World !".TrimEnd('!'); OUTPUT: Hello World string useOfTrimEnd2= "Hello World !!!!!!".TrimEnd('!'); OUTPUT: Hello World
Definition from Microsoft.com:
TrimEnd(Char) | Removes all the trailing occurrences of a character from the current string. |
TrimEnd() | Removes all the trailing white-space characters from the current string. |
TrimEnd(Char[]) | Removes all the trailing occurrences of a set of characters specified in an array from the current string. |