With O365, you can also use TEXTJOIN and TRIM, MID (usual suspects in parsing) function like below.
=TRIM(MID(SUBSTITUTE(" "&TRIM(TEXTJOIN("",TRUE,IF(ISNUMBER(MID($A4,SEQUENCE(LEN($A4)),1)+0),MID($A4,SEQUENCE(LEN($A4)),1)," ")))," ",REPT(" ",99)),99*COLUMNS($A$1:A1),99))