..im just wondering...If I have entered a sentence in a InputDialog box, using JOptionPane, how can I get the middle character per word and put it at the beginning of each word then add a "java" word at the end of each word..?..

for example:

The girl jumped

The result should be like this:

hTejava igrljava mjupedjava

..I have tried using the charAt method..but it only gets the middle character of the FIRST word..but if there could be a way I can use the charAt method to attain my objective..could you please show me how..??

..Thank you..

7 Years
Discussion Span
Last Post by draven07

First split the String into words (see the split(...) method in String class), process each word using charAt etc, the put all the words back together into a sentence.


..Actually I already used to depart the input sentence by using substring()..will it work as well as using split()?..

..by the way thanks for idea..I'll try it..


...Thank you so much..

..my question has been solved..thanks for the sentence.split() idea...it really make sense now..

..unfortunately..it takes me DAYS before i could finally understand it..

..but anyways...im really thankful...GOD BLESS...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.