从低到高 [英] convet lower to upper

查看:81
本文介绍了从低到高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何成为

来自:的秘密
是窗户.

到:

它是Window.

How do I become

covert from :

it is window.

to :

It Is Window.

推荐答案

对于您的情况,下面的代码将解决您的问题,
For your case, the code below will solve your problem,
string strToConvert = "it is window.";
string strConverted = System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(strToConvert.ToLower());



另外,为了更好地理解,请检查提供的链接:
http://support.microsoft.com/kb/312890 [ http://msdn.microsoft.com/library/kx54z3k7(v=VS.80). aspx [ ^ ]
http://msdn.microsoft.com/library/66w76es3(v=VS.80). aspx [ ^ ]

祝你好运,

OI



Also for better understanding, check the provided link:
http://support.microsoft.com/kb/312890[^]
http://msdn.microsoft.com/library/kx54z3k7(v=VS.80).aspx[^]
http://msdn.microsoft.com/library/66w76es3(v=VS.80).aspx[^]

Good luck,

OI


尝试

Try

string s = "it is window";
      s = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(s.ToLower());
      Console.WriteLine(s);


注意:-要访问CultureInfo类,您需要使用System.Globalization命名空间.作为


Note :- To access CultureInfo class you need to use System.Globalization namespace. as

using System.Globalization;



参考链接:-转换所有首字母大写,每个单词靠下 [



Reference Link :- Convert all first letter to upper case, rest lower for each word[^]


这篇关于从低到高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆