Here you can find the source of splitTokens(final String targets)
Parameter | Description |
---|---|
targets | String to split on one or more whitespace characters. |
public static List<String> splitTokens(final String targets)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.List; public class Main { /**/*from www.jav a2 s .c om*/ * Simple function to split a string into tokens which are loaded into a list, note order IS important. * * @param targets String to split on one or more whitespace characters. * @return List containing the tokens */ public static List<String> splitTokens(final String targets) { if (targets.matches(".*\\s.*")) { return Arrays.asList(targets.split("\\s+")); } else { return Arrays.asList(targets); } } }