To store the position of the first numeric digit in the string
var first_digit = - 1 ; for ( var i = n - 1 ; i >= 0 ; i -- ) { if ( s [ i ] < ' ' s [ i ] > ' ' ) { first_digit = i ; break ; } } first_digit ++ ;