Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Capitalise first letter of each word of a string in Java  RSS feed

javaFirstClass pro
Posts: 1
Eclipse IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a requirement in which, using Java program have to produce a output like

e.g input string is :


Output String should be:


I made a text (words.txt it has the list of words with first letter in uppercase) file which contains a list of words then made a java program:

comparing the string with the list of words from the words.txt file and if the word is present in the input string, replace that word from the input string. its working but, I am not sure whether it will work always so, want to know if there is any better and more efficient way?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!