aspose 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: 3739
    
  16
String myMethod = "set" + s.substring(0, 1).toUpperCase() + s.substring(1);


Joanne
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: String - can you improve my poor code?