CSharp examples for System:String Shorten
Truncate String
public class Main{ public static string Truncate(this string str, int length) { ParamIs.NotNull(() => str);/*www. j av a 2s . c om*/ return (str.Length > length ? str.Substring(0, length) : str); } }