Get the left string up to length specified in the second parameter 'length' for the passed first parameter 'param' string

Posted by Niladri.Biswas under C# category on | Points: 40 | Views : 851
public static string Left(this string param, int length)
string result = param.Substring(0, Math.Min(param.Length, length));
return result;

Comments or Responses

Login to post response