I have this code, is there an easy way to limit the amount of characters displayed to 250?
<%# trimIt(DataBinder.Eval(Container.DataItem, "WebSalesText").ToString())%>
public string trimIt(string s)
{
if (s.Length > 0 && s.IndexOf(".") > 0)
{
return (s.Substring(0, s.IndexOf(".")) + " ...");
}
else
{
return s;
}
}
Are you looking for an implementation of trimIt?