Wednesday, December 17, 2008

To GetSubString in C#.net

Hi,
We can reduce the length of the string using getSubString function, so that the length of the string is reduced to our required length.

public string GetSubString(Object str,int len)
{
string name="";
name=str+"";
if(name.Length>len)
{
name=name.Substring(0,len);
}
return name;
}

No comments: