Get the position of last character in the string
for ( int i = start ; i >= end ; i -- ) { if ( str . charAt ( i ) >= ' a ' && str . charAt ( i ) <= ' z ' ) { lastChar = i ; break ; } } return lastChar ; }