Here you can find the source of splitAndTrim(String s, String regex)
public static List<String> splitAndTrim(String s, String regex)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static List<String> splitAndTrim(String s, String regex) { if (s == null) { return null; }/*from w ww. j a va 2 s. c om*/ List<String> returnList = new ArrayList<>(); for (String string : s.split(regex)) { returnList.add(string.trim()); } return returnList; } }