FristChar

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());

Description

Select Frist character in string .

Details

Double click on the code to select all.

 

;