GetFirst

 public static string GetLast(this string source, int tailLength)
        {

            if (source == null || tailLength >= source.Length)
                return source;
            return source.Substring(source.Length - tailLength);
        }
Example:
string number = "123456789".GetFirst(5); //12345

Description

get fist n charactor in string

Details

Double click on the code to select all.

 

;