Sobes.tech
Junior — Senior

Sorting words in a string by numerical index

livecode

Task condition

You need to write a function that takes a string consisting of words, each containing a digit. The function should return a new string where the words are ordered according to the numbers found within them.


 sortWords('T4est 3a Thi1s is2') === 'Thi1s is2 3a T4est';