SyntaxFix
Write A Post
Hire A Developer
Questions
Instead of converting to a list, you could just iterate over the first string and create a second string by adding each of the digit characters you find to that new string.