find and solve ||
Please wait.....

C# String TrimEnd()

In the c# String TrimEnd() method is used to remove the occurrences of a set of characters specified in an array from the ending of the current String object that are in the trimChars parameter.


public string TrimEnd(params Char[] ch)  


ch: It takes a char array as parameter.


It returns a string.

C# String TrimEnd() Method Example

using System;
public class Program
  public static void Main()
         string str = "Hello FindAndSolve";
         char[] ch = {'e'};
         string str1= str.TrimEnd(ch);


Hello FindAndSolv