Here you can find the source of getTokens(String string)
Parameter | Description |
---|---|
string | the string. |
public static List<String> getTokens(String string)
//package com.java2s; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { /**//from www . j a v a 2 s . c om * Returns a list of tokens based on the given string. * * @param string the string. * @return the list of tokens. */ public static List<String> getTokens(String string) { if (string == null) { return null; } return new ArrayList<>(Arrays.asList(string.split("\\s"))); } }