Ignoring lowercase characters in the beginning .
let i = 0 ; for ( ; i < n ; i ++ ) { if ( str [ i ] . charCodeAt ( 0 ) >= ' ' . charCodeAt ( 0 ) && str [ i ] . charCodeAt ( 0 ) <= ' ' . charCodeAt ( 0 ) ) { i ++ ; break ; } }