i want to only reverse word strings that are more than 5 letters but in my result even the three letter words are getting reversed, how do i fix this ?
For further actions, you may consider blocking this person and/or reporting abuse
i want to only reverse word strings that are more than 5 letters but in my result even the three letter words are getting reversed, how do i fix this ?
For further actions, you may consider blocking this person and/or reporting abuse
Hannah Liao -
Peter Kelvin Torver -
Aris Kurniawan -
Ivan Ivanov -
Top comments (2)
You are reversing the characters of the whole string, then reversing the words. The if statement has no effect because you are checking the length of original string every time (not the words).
Try this:
or this: