/// <summary>
/// If lenght of the string is greater than max allowed, remove the end
/// </summary>
/// <param name="str"></param>
/// <param name="maxLength"></param>
/// <returns></returns>
public static string TrimLength(string str, int maxLength)
{
if (str.Length > maxLength)
{
str = str.Remove(maxLength);
}
return str;
}
posted @ Monday, June 02, 2008 1:12 PM