CSharp examples for System:String Strip
Remove First Symbol If Exists
using System.Text.RegularExpressions; using System.Text; using System.Linq; using System.Collections.Generic; using System;// w ww. j ava 2 s.c o m public class Main{ public static string RemoveFirstSymbolIfExists(this string src, char symbol) { if (String.IsNullOrEmpty(src)) return src; return src[0] == symbol ? src.Substring(1, src.Length - 1) : src; } }