public static string StripText(object textObj, int maxLength)
{
string text = string.Empty;
if (textObj != null && !string.IsNullOrEmpty(textObj.ToString()))
{
text = textObj.ToString();
if (text.Length > maxLength)
{
text = text.Remove(maxLength);
}
}
return text;
}
No comments:
Post a Comment