This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes upper/lower case question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "upper/lower case question" Watch "upper/lower case question" New topic
Author

upper/lower case question

choubix alex
Greenhorn

Joined: Dec 25, 2009
Posts: 22
hello,

I've understood how to display decimals and change strings to upper/lower case (so many online resources on Java!)

I was wondering what should be best in the following code where I convert a string to:
1st character: upper string, subsequent characters, lower case. (line 25, first block of code)

the code is quite lengthy...

instead of calling "myaccount.GetAnyVariableNameHere" in the out.println(), shall I create a variable and call it ?
if so: should the name be the same as in the setter/getter or different?

thanks!




and


Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Almost all of your code is irrelevant for your question. I would just create a capitalize function:



"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1756
    
    7

Or, if you don't mind the dependency, you could use the StringUtils class of the Apache Commons library.
Tried and true.


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: upper/lower case question
 
Similar Threads
Reflection Mechansim to access private data.
Constructor issues with creating a new checking account object.
Need Help Understand this.
Having trouble understanding an error code i keep getting. Please help!
help please