Remove all characters other than alphabets from string | function to remove characters and print new string ; Finding the character whose ASCII value fall under this range ; erase function to erase the character ; Driver code
function removeSpecialCharacter ( s ) { for ( let i = 0 ; i < s . length ; i ++ ) { if ( s [ i ] < ' ' s [ i ] > ' ' && s [ i ] < ' ' s [ i ] > ' ' ) { s = s . substring ( 0 , i ) + s . substring ( i + 1 ) ; i -- ; } } document . write ( s ) ; } let s = " " ; removeSpecialCharacter ( s ) ;