private static final int previousSpaceIndex ( StringBuffer sb , int seek ) { seek -- ; while ( seek > 0 ) { if ( sb . charAt ( seek ) == ' ' ) { while ( seek > 0 && sb . charAt ( seek - 1 ) == ' ' ) seek -- ; return seek ; } seek -- ; } return 0 ; }
Finds the index of the nearest space before a specified index .