question: public static String [ ] splitWithoutEscaped ( String str , char separatorChar , boolean retainEmpty ) { int len = str . length ( ) ; if ( len == 0 ) { return new String [ 0 ] ; } List < String > list = new ArrayList < String > ( ) ; int i = 0 ; int start = 0 ; boolean match = false ; while ( i < len ) { if ( str . charAt ( i ) == '\\' ) { match = true ; i += 2 ; } else if ( str . charAt ( i ) == separatorChar ) { if ( retainEmpty || match ) { list . add ( str . substring ( start , i ) ) ; match = false ; } start = ++ i ; } else { match = true ; i ++ ; } } if ( retainEmpty || match ) { list . add ( str . substring ( start , i ) ) ; } return list . toArray ( new String [ list . size ( ) ] ) ; }
target:  does not take into account escaped separators