Iterate over the string
for ( let i = 0 ; i < s . length ; i ++ ) { if ( s . charAt ( i ) == ' ' || s . charAt ( i ) == ' ' || s . charAt ( i ) == ' ' || s . charAt ( i ) == ' ' || s . charAt ( i ) == ' ' ) {