Skip to main content
Account for scoring clarification
Source Link
Comintern
  • 3.7k
  • 4
  • 22
  • 27

VBScript, 190 (164 without function declaration)

Function f(i) For x=1 To Len(i) c=Mid(i,x,1) If Not IsNumeric(c) Then Mid(i,x,1)=" " End If Next Do l=Len(i) i=Replace(i," "," ") l=l-Len(i) Loop Until l=0 f=Split(Trim(i)," ") End Function 

While not competitive at all, I'm surprised that VBScript comes out this short on this given how verbose it is (13 bytes for the CRs alone). It loops through the string, replacing any non-numeric characters with spaces, then reduces all the whitespace to single spaces, and then uses a space delimiter to divide it.

Test cases

Input: "ab5c0x" Output: 5,0 Input: "z526ks4f.;8]\p" Output: 526,4,8 

VBScript, 190

Function f(i) For x=1 To Len(i) c=Mid(i,x,1) If Not IsNumeric(c) Then Mid(i,x,1)=" " End If Next Do l=Len(i) i=Replace(i," "," ") l=l-Len(i) Loop Until l=0 f=Split(Trim(i)," ") End Function 

While not competitive at all, I'm surprised that VBScript comes out this short on this given how verbose it is (13 bytes for the CRs alone). It loops through the string, replacing any non-numeric characters with spaces, then reduces all the whitespace to single spaces, and then uses a space delimiter to divide it.

Test cases

Input: "ab5c0x" Output: 5,0 Input: "z526ks4f.;8]\p" Output: 526,4,8 

VBScript, 190 (164 without function declaration)

Function f(i) For x=1 To Len(i) c=Mid(i,x,1) If Not IsNumeric(c) Then Mid(i,x,1)=" " End If Next Do l=Len(i) i=Replace(i," "," ") l=l-Len(i) Loop Until l=0 f=Split(Trim(i)," ") End Function 

While not competitive at all, I'm surprised that VBScript comes out this short on this given how verbose it is (13 bytes for the CRs alone). It loops through the string, replacing any non-numeric characters with spaces, then reduces all the whitespace to single spaces, and then uses a space delimiter to divide it.

Test cases

Input: "ab5c0x" Output: 5,0 Input: "z526ks4f.;8]\p" Output: 526,4,8 
typo in the CR count.
Source Link
Comintern
  • 3.7k
  • 4
  • 22
  • 27

VBScript, 190

Function f(i) For x=1 To Len(i) c=Mid(i,x,1) If Not IsNumeric(c) Then Mid(i,x,1)=" " End If Next Do l=Len(i) i=Replace(i," "," ") l=l-Len(i) Loop Until l=0 f=Split(Trim(i)," ") End Function 

While not competitive at all, I'm surprised that VBScript comes out this short on this given how verbose it is (1413 bytes for the CRs alone). It loops through the string, replacing any non-numeric characters with spaces, then reduces all the whitespace to single spaces, and then uses a space delimiter to divide it.

Test cases

Input: "ab5c0x" Output: 5,0 Input: "z526ks4f.;8]\p" Output: 526,4,8 

VBScript, 190

Function f(i) For x=1 To Len(i) c=Mid(i,x,1) If Not IsNumeric(c) Then Mid(i,x,1)=" " End If Next Do l=Len(i) i=Replace(i," "," ") l=l-Len(i) Loop Until l=0 f=Split(Trim(i)," ") End Function 

While not competitive at all, I'm surprised that VBScript comes out this short on this given how verbose it is (14 bytes for the CRs alone). It loops through the string, replacing any non-numeric characters with spaces, then reduces all the whitespace to single spaces, and then uses a space delimiter to divide it.

Test cases

Input: "ab5c0x" Output: 5,0 Input: "z526ks4f.;8]\p" Output: 526,4,8 

VBScript, 190

Function f(i) For x=1 To Len(i) c=Mid(i,x,1) If Not IsNumeric(c) Then Mid(i,x,1)=" " End If Next Do l=Len(i) i=Replace(i," "," ") l=l-Len(i) Loop Until l=0 f=Split(Trim(i)," ") End Function 

While not competitive at all, I'm surprised that VBScript comes out this short on this given how verbose it is (13 bytes for the CRs alone). It loops through the string, replacing any non-numeric characters with spaces, then reduces all the whitespace to single spaces, and then uses a space delimiter to divide it.

Test cases

Input: "ab5c0x" Output: 5,0 Input: "z526ks4f.;8]\p" Output: 526,4,8 
Source Link
Comintern
  • 3.7k
  • 4
  • 22
  • 27

VBScript, 190

Function f(i) For x=1 To Len(i) c=Mid(i,x,1) If Not IsNumeric(c) Then Mid(i,x,1)=" " End If Next Do l=Len(i) i=Replace(i," "," ") l=l-Len(i) Loop Until l=0 f=Split(Trim(i)," ") End Function 

While not competitive at all, I'm surprised that VBScript comes out this short on this given how verbose it is (14 bytes for the CRs alone). It loops through the string, replacing any non-numeric characters with spaces, then reduces all the whitespace to single spaces, and then uses a space delimiter to divide it.

Test cases

Input: "ab5c0x" Output: 5,0 Input: "z526ks4f.;8]\p" Output: 526,4,8