Method which is used to get first n (length) characters from string

Nadeemshaik
Posted by Nadeemshaik under C# category on | Points: 40 | Views : 776
  public string String_Truncate(string source, int length)
{
try
{
if (source.Length > length)
{
source = source.Substring(0, length);
}
}
catch (Exception ex)
{
//
}
return source;
}

Comments or Responses

Login to post response