Uppercased the first letter of a string - CSharp System

CSharp examples for System:String Case

Description

Uppercased the first letter of a string

Demo Code


using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.Text;
using System.Net.Mail;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System;//  w  w  w  . j av  a 2 s .  c  o  m

public class Main{
        /// <summary>
        /// Uppercased the first letter of a string
        /// </summary>
        public static string UpperFirstLetter(string input)
        {
            if (string.IsNullOrEmpty(input))
            {
                return input;
            }

            return char.ToUpper(input.First()) + input.Substring(1);
        }
}

Related Tutorials