private static List < String > split ( String str , char delim ) { List < String > result = Lists . newArrayList ( ) ; int currPartStart = 0 ; while ( true ) { int currPartEnd = str . indexOf ( delim , currPartStart ) ; if ( currPartEnd == - 1 ) { result . add ( str . substring ( currPartStart ) ) ; break ; } else { result . add ( str . substring ( currPartStart , currPartEnd ) ) ; currPartStart = currPartEnd + 1 ; } } return result ; }
Splits a string into tokens at the specified delimiter .