Capitalize first letter of each word in java

By | August 8, 2020

Capitalize first letter of each word in Java:

1. Split the string using space and assign it to an string array.

2. Loop through each string

3. Get the first letter of each string using substring method and capitalize it.

4. Get the remaining letters using another substring method which starts at index position 1.

5. Now concatenate/append all the strings to a new string.



Recommended Posts:

Covert String to int in Java

Star pattern programs in Java

Get last 4 chars from String

Timeout test in TestNG

How to clear an arraylist in java

Java interview questions

Real-time selenium interview questions

SQL quick reference for interview preparation



Tags: capitalize first letter of each word in java

arrays tostring in java | selenium interview questions | binary search






Note: If you like and want to contribute articles, then please send your articles at

Leave a Reply

Your email address will not be published. Required fields are marked *