Here you can find the source of splitIgnoringQuotes(String str, char separatorChar)
public static String[] splitIgnoringQuotes(String str, char separatorChar)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { private static final String[] EMPTY_STRING_ARRAY = new String[0]; public static String[] splitIgnoringQuotes(String str, char separatorChar) { if (str == null) { return null; }/*from w ww. j a va 2 s.c o m*/ int len = str.length(); if (len == 0) { return EMPTY_STRING_ARRAY; } List<String> list = new ArrayList<String>(); int i = 0; int start = 0; boolean match = false; while (i < len) { if (str.charAt(i) == '"') { i++; while (i < len) { if (str.charAt(i) == '"') { i++; break; } i++; } match = true; continue; } if (str.charAt(i) == separatorChar) { if (match) { list.add(str.substring(start, i)); match = false; } start = ++i; continue; } match = true; i++; } if (match) { list.add(str.substring(start, i)); } return list.toArray(new String[list.size()]); } }