Split numeric , alphabetic and special symbols from a String | Javascript program to split an alphanumeric string using stringbuffer ; Driver method
function splitString ( str ) { let alpha = " " ; let num = " " ; let special = " " ; for ( let i = 0 ; i < str . length ; i ++ ) { if ( ! isNaN ( String ( str [ i ] ) * 1 ) ) num += str [ i ] ; else if ( ( str [ i ] >= ' ' && str [ i ] <= ' ' ) || ( str [ i ] >= ' ' && str [ i ] <= ' ' ) ) alpha += str [ i ] ; else special += str [ i ] ; } document . write ( alpha + " " ) ; document . write ( num + " " ) ; document . write ( special + " " ) ; } let str = " " ; splitString ( str ) ;