I\'d like to write an extension method to the String class so that if the input string to is longer than the provided length N, only the first
String
N
Simply:
public static String Truncate(String input,int maxLength) { if(input.Length > maxLength) return input.Substring(0,maxLength); return input; }