How to Capitalize String in Java Program

Capitalize String in Java

This example program about, How to Capitalize String in Java.

Capitalize String in Java without using Library

CapitalizeExample1.java

Output
Dinesh Krishnan

Capitalize String in Java using Apache Commons Library

commons-lang3-3.5.jar

Download Here

CapitalizeExample2.java

Output
Before Capitalize :dinesh krishnan
Afer Captialize :Dinesh Krishnan

References

1. Apache Commons API
2. Apache Commons WordUtil API
3. Java String replaceFirst() method