This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes to Lower/ upper case.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "to Lower/ upper case...." Watch "to Lower/ upper case...." New topic
Author

to Lower/ upper case....

Wolfgang Obi
Ranch Hand

Joined: Dec 05, 2005
Posts: 134
if "inputEntry" is a string...
how do i apply the method "toLowerCase" to this string to convert all elements of ths string to lower case letters if any?...

like this?--->
Pavel Kubal
Ranch Hand

Joined: Mar 13, 2004
Posts: 356
String s = "teST";
String s2 = s.toLowerCase();

Strings are immutable. String's methods return new object. So you have to assign reference returned by toLowerCase() method to some variable even to variable "s".
Wolfgang Obi
Ranch Hand

Joined: Dec 05, 2005
Posts: 134
thank's a bunch!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: to Lower/ upper case....
 
Similar Threads
the print out is just beyond my expectation
String code
Display tag and sorting
comparing Strings
IgnoreCase