File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes String - can you improve my poor code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String - can you improve my poor code?" Watch "String - can you improve my poor code?" New topic
Author

String - can you improve my poor code?

Marco Vanoli
Ranch Hand

Joined: Jan 12, 2005
Posts: 99
Getting string "value" a want a new one "setValue"..



This work but i don' t like it, somone have a best way to get the same result?


bye, <br />Marco
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3548
    
  15
String myMethod = "set" + s.substring(0, 1).toUpperCase() + s.substring(1);


Joanne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: String - can you improve my poor code?