public static string TrimToEmpty(this string str) { if (str == null || str.Length == 0) return String.Empty; else return str.Trim(); }