private static int nextSep ( String desc , int pos ) { int pos2 = desc . length ( ) ; // assume we'll find none int candidate = desc . indexOf ( ' ' , pos ) ; if ( candidate > 0 ) { pos2 = candidate ; } candidate = desc . indexOf ( ' ' , pos ) ; if ( candidate > 0 ) { pos2 = Math . min ( candidate , pos2 ) ; } candidate = desc . indexOf ( ' ' , pos ) ; if ( candidate > 0 ) { pos2 = Math . min ( candidate , pos2 ) ; } return pos2 ; }
Find the first subsequent occurrance of + - or ~ in the string or the end of line if none are there