FristChar
Select Frist character in string .
Source
public static class MehrdadExtensions
{
public static string FristChar(this string input)
{
if (!string.IsNullOrEmpty(input))
{
if (input.Length >= 1)
{
return input.Substring(0, 1);
}
else
{
return input;
}
}
else
{
return null;
}
}
}
Example
string name = "mehrdad";
Response.Write("Name is : " + name);
Response.Write("<br />");
Response.Write("Frist Char : "+name.FristChar());