Posts Tagged ‘C#’

tsl

First Character Capitalize in String

By Head Lounger • December 12th, 2008 • Bugs/Fixes Tags: , , ,

We ran into this issue at work. We had a string that needed every first letter to transform to a capital letter.

ASP.NET C#

string text = areatext; //areatext would be the dynamic string
string expr = @"[A-Z]";
text = Regex.Replace(text,expr," $&");