question: public static String [ ] splitOnCharWithQuoting ( String s , char splitChar , char quoteChar , char escapeChar ) { List < String > result = new ArrayList < > ( ) ; int i = 0 ; int length = s . length ( ) ; StringBuilder b = new StringBuilder ( ) ; while ( i < length ) { char curr = s . charAt ( i ) ; if ( curr == splitChar ) { if ( b . length ( ) > 0 ) { result . add ( b . toString ( ) ) ; b = new StringBuilder ( ) ; } i ++ ; } else if ( curr == quoteChar ) { i ++ ; while ( i < length ) { curr = s . charAt ( i ) ; if ( curr == escapeChar ) { b . append ( s . charAt ( i + 1 ) ) ; i += 2 ; } else if ( curr == quoteChar ) { i ++ ; break ; } else { b . append ( s . charAt ( i ) ) ; i ++ ; } } } else { b . append ( curr ) ; i ++ ; } } if ( b . length ( ) > 0 ) { result . add ( b . toString ( ) ) ; } return result . toArray ( new String [ 0 ] ) ; }
target:  This function splits the String s into multiple Strings using the splitChar.  However, it provides an quoting facility: it is possible to quote strings with the quoteChar. If the quoteChar occurs within the quotedExpression, it must be prefaced by the escapeChar