Here you can find the source of splitField(String fieldWithSeparator, String separator)
Parameter | Description |
---|---|
fieldWithSeparator | a parameter |
separator | a parameter |
public static List<String> splitField(String fieldWithSeparator, String separator)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { /**//from www .ja va 2s . c o m * Splits a multiple-value composed field into a list of String values * * @param fieldWithSeparator * @param separator * @return */ public static List<String> splitField(String fieldWithSeparator, String separator) { List<String> fieldsList = new ArrayList<String>(); if (fieldWithSeparator == null) { return fieldsList; } String[] fields = fieldWithSeparator.split(separator); fieldsList = new ArrayList<String>(Arrays.asList(fields)); return fieldsList; } }