CSharp examples for System:String Case
To Sentence Case
using System.Text.RegularExpressions; using System.Text; using System.Security.Cryptography; using System.Web; using System.Linq; using System.Collections.Generic; using System;/* ww w. j a va 2 s.c o m*/ public class Main{ public static string ToSentenceCase(string str) { return Regex.Replace(str, "[a-z][A-Z]", m => m.Value[0] + " " + char.ToLower(m.Value[1])); } }