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

一曲冷凌霜 提交于 2019-11-26 19:22:36
 
  ///上一篇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);
        

转载于:https://www.cnblogs.com/xiaoshuai/archive/2010/06/05/1752364.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!