BF2Statistics.StringExtensions.UppercaseFirst C# (CSharp) Method

UppercaseFirst() public static method

Takes a string, and Uppercases the first letter
public static UppercaseFirst ( this s ) : string
s this The input string
return string
        public static string UppercaseFirst(this string s)
        {
            // Make sure we dont have an empty input
            if (String.IsNullOrWhiteSpace(s))
                return String.Empty;

            // Convert to character array
            char[] a = s.ToCharArray();
            a[0] = Char.ToUpper(a[0]);
            return new String(a);
        }