By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,006 Members | 513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,006 IT Pros & Developers. It's quick & easy.

C#NET2008 Upper case and Lower case Character

100+
P: 126
Hullo Awesome Helpers,
Thank you for helping me earlier.
I am back with new problem. I am trying to covert a TEXT String into either Lower and Upper case characterS. (Upper case Eg. ALFRED instead of alfred)
(Lower case Eg. thompson instead of THOMPSON )

Please help me.

Coding
//convert to lower case
string strName = lcase(this.txtName.text) <-- not working

//convert country to Upper case
string strCountry =ucase(this.textCountry.text)<-not work

Thank you for your help.

Cheers,
Lennie
Oct 26 '10 #1
Share this Question
Share on Google+
6 Replies

GaryTexmo
Expert 100+
P: 1,501
http://msdn.microsoft.com/en-us/libr...=VS.71%29.aspx

Have a look there. The ToUpper and ToLower methods on a string are what you're looking for. The MSDN reference is great for people just learning the framework, just do a search on the object you're using :)
Oct 26 '10 #2

100+
P: 126
After view the MSDN Website
I convert this coding that I posted earlier to this structure;

//convert country to Upper case
string strCountry = Uppercase(this.textCountry.text)

And it generates this error message:

Error 1 The name 'Uppercase' does not exist in the current context
Oct 26 '10 #3

GaryTexmo
Expert 100+
P: 1,501
Please review both my post and the MSDN article. I'm not sure how you got Uppercase as a viable method to call, the error message is pretty clear here.

The link is a list of methods available on the string class, you'll want the ones that convert to upper or lower case. Read the link, find the appropriate method, and click it's name. You'll find a code example there.
Oct 26 '10 #4

P: 8
You have to use it in the following way
Expand|Select|Wrap|Line Numbers
  1. string strCountry = this.textBox1.Text.ToUpper();
  2.  
and for lowercase
Expand|Select|Wrap|Line Numbers
  1. string strCountry = this.textBox1.Text.ToLower();
  2.  
Oct 26 '10 #5

100+
P: 126
Hullo Robit
Thank you for sharing the sample coding with me. That is awesomea and my coding is working how.

You are wonderful and generous in sharing your knowledge with me. I have learned somehthing new from you. thank you very much
Oct 26 '10 #6

NeoPa
Expert Mod 15k+
P: 31,770
Sorry Rohit.

I've reset the Best Answer in this case as it is simply a repeat of what had already been stated in an earlier reply.

I have no idea why Lennie chose to assign yours in place of the earlier, perfectly good, reply, but that is not what the feature is for.

This is in no way a criicism of your post - simply that post #2 was at least as good and already posted. It may not have been an abuse, but it was certainly illogical.
Oct 28 '10 #7

Post your reply

Sign in to post your reply or Sign up for a free account.