Converting lowercase to capitals

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2005
Posts: 1
Reputation: blastocyst is an unknown quantity at this point 
Solved Threads: 0
blastocyst blastocyst is offline Offline
Newbie Poster

Converting lowercase to capitals

 
0
  #1
Oct 27th, 2005
I guess I'm going to use ascii values here, taking a string and converting all letters to lowercase. I'd rather use a for loop than a huge switch statement. How do I do this?
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: Converting lowercase to capitals

 
0
  #2
Oct 27th, 2005
String s = "lowercase";
String s2 = s.toUpperCase();

Remembers Strings are immutable so this won't work:
String s = "lowercase";
s.toUpperCase();
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 2736 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC