To capitalize a string means to change the first letter


To capitalize a string means to change the first letter of each word in the string to uppercase. For example, a capitalized version of "Now is the time to act!" is "Now Is The Time To Act!". Write a Java application that asks for text and then prints a capitalized version of the string.

You can retrieve a character from a String by using the charAt(index) method where the index is a number between 0 and the length of the string minus 1. Use the help documention to determine how to find the number of characters in a string.

Note that a letter is the first letter in a word if it is not immediately preceded by another letter. There is a standard boolean-valued function Character.isLetter(char) that can be used to test whether its parameter is a letter. There is another standard char-valued function Character.toUpperCase(char) that returns a capitalized version of the single letter passed to it as a parameter. That is, if the parameter is a letter, it returns the uppercase version of the letter. If the parameter is not a letter, then it returns a copy of the parameter.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: To capitalize a string means to change the first letter
Reference No:- TGS092012

Expected delivery within 24 Hours