2
public String capitalizeTitle(String title) {4
char[] ch = title.toCharArray();7
for (int i = 0; i < len; ++i) {9
int firstIndex = i; // store the first index of the word11
while (i < len && ch[i] != ' ') {13
Character.toLowerCase(14
ch[i]); // converting the character at ith index to lower case ony by one18
// if word is of length greater than 2, then turn the first character of the word to upper20
if (i - firstIndex > 2) {22
Character.toUpperCase(23
ch[firstIndex]); // converting the first character of the word to upper case27
return String.valueOf(ch); // return the final result by converting the char array into string