how to reverse words in a sentence without using split or string tokenizer.
I/p :- how are you
O/p :- you are how
skimmpy
0
Newbie Poster
Recommended Answers
Jump to PostSince you cannot use split and StringTokenizer, one way is to check one by one of each character from the string if there are any delimiter, put the words inside an array, and then reverse them.
Jump to PostThere are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in coding your homework for you.
DaniWeb Member Rules include:
"Do provide evidence of having done some work yourself if …
Jump to Postwhy make it so complex? you can have the entire functionality from String object to reversed String object in ten lines of code, without having to go recursive.
Jump to PostI have already written code which does the same. Just wanted to find a better way to do it.So i could know where I could improve. This aint any school assignment either.
OK, thanks for clarifying that. I'm sure you can understand how it looked from your first post.
…
All 16 Replies
leodash
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
skimmpy
0
Newbie Poster
stultuske
1,116
Posting Maven
Featured Poster
skimmpy
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
stultuske
1,116
Posting Maven
Featured Poster
skimmpy
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
skimmpy
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
skimmpy
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
skimmpy
0
Newbie Poster
Jyotiranjan_1
0
Newbie Poster
stultuske
1,116
Posting Maven
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.