+ 6
I would like to get explanation for this code?
5 Antworten
+ 7
Elva thanks you did it but still i have doubt can you explain this line like I am five years old
while ((index =str.indexOf(' ',index+1))>0)
+ 6
Hafsa Hussein It means: while there are spaces in string... If space is found, search from element next to that space so that space won't get repeated... If no space is found, kill while loop
+ 6
Elva explained it correctly. 🤓👌
+ 5
While spaces exist push their locations in array then print array