CSharp examples for System:String SubString
Get String from Left Or Empty
using System.Text; using System.IO;/* w w w . j a va 2 s. c o m*/ using System.Globalization; using System.Collections.Generic; using System; public class Main{ public static string LeftOrEmpty(this string value, int maxLength) { if (value == null) return string.Empty; if (value.Length > maxLength) { value = value.Substring(0, maxLength); } return value; } }