+ 4
How can i sort a string
I have one string what is your name... I want this string like is name what your.
7 Respuestas
+ 3
What language are we talking about?
You could split each word by using the split function with the " " (space) value. Then create a new string with the new strings, which should be words.
+ 11
String Sort:
https://code.sololearn.com/cU9baTc1pley/?ref=app
+ 5
Have to tried to get it?
0
Yeah I have tried this but each character is sorted... 🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ!
0
Split the string with a space into array of words. Then by comparing first (0th) chars of the words sort the words( by swapping..). if you dont get it reply..
0
https://code.sololearn.com/ck3ssTJ27Go6/?ref=app
I sorted string like this... If anyone have other solution please share it..
0
Jayashree Kusalkar
I thought you need only sorting with 1st charecter of words . so i made this code then.
Hoping it helps to give idea to another way to split words.
look this for split input into array.
https://code.sololearn.com/cUsgpFz7xaOe/?ref=app
I try to extend it to total words later and post here.
edit:
https://code.sololearn.com/cx9Ti66w3mwo/?ref=app
just i continued to update above code but still it can be improvable by using substring method. if you want that also give a reply...