字符串值应转换为大写字母 [英] String value should be converted into Capital letters

查看:152
本文介绍了字符串值应转换为大写字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







我有一个小疑问,在我的页面中我有一个字符串数据类型值。无论我传递的字符串值应该转换为大写字母。如何做到这一点



例如:



string x =Null;

string x =nUll;

string x =NUll;

string x =NULL;

.........

.........



这些是我的样本值,无论我通过什么,我想将该值转换为大写字母只是如何做到这一点。



最终结果:



NULL



任何人都可以帮助我...



在预先感谢....

解决方案

使用string.ToUpper()函数来完成它。



:)


使用ToUpperInvariant方法,比如,



 x。 ToUpperInvariant(); 


Hi,


I have a small doubt , in my page i have a string datatype value . whatever i pass the string value that should be converted into capital letter .How to do this

for ex:

string x="Null";
string x="nUll";
string x="NUll";
string x="NULL";
.........
.........

these are my sample values , whatever i pass i want to be convert that value into capital letters only how to do this.

final result:

NULL

can anyone help me...

Thanks in Advance....

解决方案

Use string.ToUpper() function to do it.

:)


use ToUpperInvariant method like,

x.ToUpperInvariant();


这篇关于字符串值应转换为大写字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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