Java String Capitalize

When I was looking for first time the method to capitalize a Java String, I was searching in the Sun Official API but… there isn’t.

Strange not?

No problem this is the code to capitalize a Java String:

String mystring = (mystring.substring(0, 1).toUpperCase() + mystring.substring(1).toLowerCase()).trim();

You can also download it from Javamarco google code repository