Capitalize the first letter of each word in a string of text

private string Capatalize(string StringToCapatalize)
{
 dynamic ReturnString = StringToCapatalize;
 dynamic CapsString = ReturnString.ToLower;
 CapsString = CapsString.Replace("o'", "o" + Strings.ChrW(8203) + "'");
 ReturnString = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(CapsString);
 return ReturnString;
}

No comments:

Post a Comment