public static List<String> splitHeaderString(String s,char splitChar){
  List<String> result=new ArrayList<String>(8);
  boolean parsingQuotedString=false;
  int i, startIdx=0;
  for (i=0; i < s.length(); i++) {
    char c=s.charAt(i);
    if (c == splitChar && !parsingQuotedString) {
      result.add(s.substring(startIdx,i));
      startIdx=i + 1;
    }
 else     if (c == '"') {
      parsingQuotedString=!parsingQuotedString;
    }
  }
  if (startIdx < s.length()) {
    result.add(s.substring(startIdx));
  }
  return result;
}

public static List < String > splitHeaderString ( String s , char splitChar ) { List < String > result = new ArrayList < String > ( 8 ) ; boolean parsingQuotedString = false ; int i , startIdx = 0 ; for ( i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( c == splitChar && ! parsingQuotedString ) { result . add ( s . substring ( startIdx , i ) ) ; startIdx = i + 1 ; } else if ( c == '"' ) { parsingQuotedString = ! parsingQuotedString ; } } if ( startIdx < s . length ( ) ) { result . add ( s . substring ( startIdx ) ) ; } return result ; }
splits the supplied string into sub parts using the specified splitchar as a separator , ignoring occurrences of this character inside quoted strings .
