public static string FirstLetterCapital(string strData)
{
string strReturn = string.Empty;
strReturn = strData[0].ToString().ToUpper();
for (int i = 1; i < strData.Length; i++)
{
strReturn += strData[i].ToString().ToLower();
if (strData[i] == ' ' && (i+1) < strData.Length ) //
{
strReturn += strData[i + 1].ToString().ToUpper();
i++;
}
}
return strReturn;
}
Input: WINDOWS FORMS PROGRAMMING
Output: Windows Forms Programming
转载于:https://www.cnblogs.com/samblog/archive/2012/04/01/2428742.html