How to truncate the data in the column

Platform: ASP.NET|Category: ADO.NET

VB.NET

Protected function TruncateData( Byval strNotes as string)
If strNotes.Length > 20 then
	Return strNotes.Substring(0,20) + '...'
Else
	return strnotes
End function

C#

protected string TruncateData( string strNotes  )
{
if (strNotes.Length > 20)
{
	return strNotes.Substring(0,20) + '...';
}
else
{
	return strNotes;
}
}