转换字符把每个字符串的首字母转换大写

/// <summary>
/// 需要转换的字符把每个字符串的首字母转换大写
/// </summary>
/// <param name="strChange">需要转换的字符</param>
/// <returns>返回已经转换的字符</returns>
public static string ChangeFirstLetterToUpper(string strChange)
{
   try
   {
      string tempFirst = strChange.Substring(0, 1);
      string tempElse = strChange.Substring(1, strChange.Length - 1);
      return (tempFirst.ToUpper() + tempElse);
   }
   catch
   {
       return strChange;
   }
}

posted @ 2011-08-09 16:53  .net|C#|js|jquery|css|div|html  阅读(3740)  评论(0编辑  收藏  举报