Here you can find the source of splitWithoutWhitespace(String source, String separator)
public static String[] splitWithoutWhitespace(String source, String separator)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static String[] splitWithoutWhitespace(String source, String separator) { List<String> result = new ArrayList<String>(); String[] items = source.split(separator); for (String s : items) { if (!"".equals(s.trim())) { result.add(s.trim());//from w w w. j av a2s . c o m } } return result.toArray(new String[result.size()]); } }