+ 1
A Java code which returns a string after reversing only the alphabets in a sentence which is passed as an argument the method.
Note: 1. reversing has to be done word-by-word. 2. Any inbuilt method except {length(), charAt(), indexOf(), compareTo(), equals()} should not be used. 3. Do not use hashmap. Input String : It Costs 25000rs for 1 LCD Projector. Output: tI stsoC 25000sr rof 1 DCL rotcejorP.
7 odpowiedzi
+ 2
I thought to solve it using stack.. rather than using an extra array and splitting string into array of words and reversing each word. But I'm stucked with my logic.
+ 1
Is this your assignment? if so then, it would be required of you to try it on your own first. If you run into difficulties though, you may save the code in SoloLearn, and share the saved code link within your thread Description (above) in order for others to analyse it, and assist you through.
Follow the below guide to sharing links in this forum 👍
https://www.sololearn.com/post/75089/?ref=app
+ 1
I did it using charAt().
+ 1
Prashant Pal
Is it solved?
Mark your question [SOLVED] if so ...
+ 1
[SOLVED]
0
Is it possible to do it without using charAt()?
0
Prashant Pal
I can't find a Java code in your profile codes section. Did you save the code here or not?
If it's ok maybe you can share the code for someone who may need it as reference in the future.