@Test public void changeQuoteCharacterPreserveQuotes() { final String[] split = ListSplitter.splitPreserveQuotes("\"", true, "\"Helsinki, Finland\", Boston"); assertEquals(2, split.length); assertEquals("\"Helsinki, Finland\"", split[0]); assertEquals("Boston", split[1]); }
public static String[] splitPreserveQuotes(final String quoteCharacter, final boolean trim, final String valueList) { final String[] split = valueList.split(","); final String[] result = new InnerSplitter(quoteCharacter, trim, split).getSplit(); for (int i = 0; i < result.length; i++) { if (result[i].contains(",")) { result[i] = quoteCharacter + result[i] + quoteCharacter; } } return result; }
ListSplitter { public static String[] splitPreserveQuotes(final String quoteCharacter, final boolean trim, final String valueList) { final String[] split = valueList.split(","); final String[] result = new InnerSplitter(quoteCharacter, trim, split).getSplit(); for (int i = 0; i < result.length; i++) { if (result[i].contains(",")) { result[i] = quoteCharacter + result[i] + quoteCharacter; } } return result; } }
ListSplitter { public static String[] splitPreserveQuotes(final String quoteCharacter, final boolean trim, final String valueList) { final String[] split = valueList.split(","); final String[] result = new InnerSplitter(quoteCharacter, trim, split).getSplit(); for (int i = 0; i < result.length; i++) { if (result[i].contains(",")) { result[i] = quoteCharacter + result[i] + quoteCharacter; } } return result; }  }
ListSplitter { public static String[] splitPreserveQuotes(final String quoteCharacter, final boolean trim, final String valueList) { final String[] split = valueList.split(","); final String[] result = new InnerSplitter(quoteCharacter, trim, split).getSplit(); for (int i = 0; i < result.length; i++) { if (result[i].contains(",")) { result[i] = quoteCharacter + result[i] + quoteCharacter; } } return result; }  static String[] split(final String valueList); static String[] split(final String quoteCharacter,
                                 final boolean trim,
                                 final String valueList); static String[] splitPreserveQuotes(final String quoteCharacter,
                                               final boolean trim,
                                               final String valueList); }
ListSplitter { public static String[] splitPreserveQuotes(final String quoteCharacter, final boolean trim, final String valueList) { final String[] split = valueList.split(","); final String[] result = new InnerSplitter(quoteCharacter, trim, split).getSplit(); for (int i = 0; i < result.length; i++) { if (result[i].contains(",")) { result[i] = quoteCharacter + result[i] + quoteCharacter; } } return result; }  static String[] split(final String valueList); static String[] split(final String quoteCharacter,
                                 final boolean trim,
                                 final String valueList); static String[] splitPreserveQuotes(final String quoteCharacter,
                                               final boolean trim,
                                               final String valueList);  }