C#将首字母自动转换大写

 
  ///上一篇PinYin设置的枚举
  [System.FlagsAttribute]
    public enum PinYinOptions
    {
        None = 0,
        FirstLetterOnly = 1,	//只转换拼音首字母,默认转换全部
        TranslateUnknowWordToInterrogation = 1 << 1,		//转换未知汉字为问号,默认不转换
        EnableUnicodeLetter = 1 << 2,//保留非字母、非数字字符,默认不保留
    }
  //转换需要用空格区分
CultureInfo cultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
          TextInfo text = cultureInfo.TextInfo;
          RandName = text.ToTitleCase(RandName);
        
posted @ 2010-06-05 19:03  SESSION MODE  阅读(1916)  评论(0编辑  收藏  举报