Trim Start - CSharp System

CSharp examples for System:String Strip

Description

Trim Start

Demo Code


using System.Text.RegularExpressions;
using System.Text;
using System.Net;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System;//from  w w  w  .j a  va2 s  .  c om

public class Main{
        public static string TrimStart(this string input, string trimString)
        {
            var result = input;
            while (result.StartsWith(trimString))
                result = result.Substring(trimString.Length);
            return result;
        }
}

Related Tutorials