I have a task:
You need to write a function that sorts the tape. Each number in the tape will contain some number. This figure will mean the position that the word will take in the end.
Specification: Numbers can be from 1 to 9. 1 will be the first word (not 0). If the ribbon is empty, return the empty ribbon. The words in the input tape will contain only valid values.
Example:
sortString("g5et ski3lls on6 use1 your2 to4 7top")Result:
use1 your2 ski3lls to4 g5et on6 7top.
My question is how to sort the words in a string?