C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
C# String TrimEnd()The C# TrimEnd() method is used to remove all trailing occurrences of a set of characters specified in an array from the current String object. Signaturepublic string TrimEnd(params Char[] ch) Parameterch: It takes a char array as parameter. ReturnIt returns a string. C# String TrimEnd() Method Exampleusing System; public class StringExample { public static void Main(string[] args) { string s1 = "Hello C#"; char[] ch = {'#'}; string s2 = s1.TrimEnd(ch); Console.WriteLine(s2); } } Output: Hello C
Next TopicC# String TrimStart()
|