Capitalize first letter of each word in java

By | June 23, 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

 

Source: http://www.apache.org

Tags: capitalize first letter of each word in java

 

Note: If you like selenium99.com and want to contribute articles, then please send your articles at techygeeks99@gmail.com.

Leave a Reply

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