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