String s ="0000012345678901234567890".TrimStart(new Char[] { '0' } ); // s = "12345678901234567890"
using System; using System.Text.RegularExpressions; public class HelloWorld { public static void Main(string[] args) { String _str = "0000132423423424565443546546356546454654633333a"; Regex _removeLeadingZeroesReg = new Regex(@"^0+(?=\d)"); Console.WriteLine(string.Format("{0} => {1}", _str, _removeLeadingZeroesReg.Replace(_str, ""))); } }