CSharp examples for System:String Case
Capitalizes the first letter of the String in the StringBuilder object
using System.Text; using System;//from w w w . j av a2s.co m public class Main{ /// <summary> /// Capitalizes the first letter of the String in the StringBuilder object /// </summary> /// <param name="sb">StringBuilder object</param> /// <returns>Returns a new stringbuilder object</returns> public static StringBuilder CapitalizeFirst(this StringBuilder sb) { Validation.IsNotNull(sb, "sb"); Validation.Validate(sb.Length > 0); return sb.Replace(sb[0], char.ToUpper(sb[0]), 0, 1); } }