Here you can find the source of extractTokens(String text, String delim)
Parameter | Description |
---|---|
tokenCollection | a parameter |
tokenStr | a parameter |
delimeter | a parameter |
public static List<String> extractTokens(String text, String delim)
//package com.java2s; /*L//from w w w .j a va 2 s . co m * Copyright SAIC * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/stats-application-commons/LICENSE.txt for details. */ import java.util.ArrayList; import java.util.List; public class Main { /** * This method will extract tokens from a string containing multiple tokens * and place the tokens in a collection. This is used for example, to parse strings containing multiple GO or PATHWAY ids. * @param tokenCollection * @param tokenStr * @param delimeter */ public static List<String> extractTokens(String text, String delim) { List<String> tokenList = new ArrayList<String>(); if (text != null) { String[] tokens = text.split(delim); for (int i = 0; i < tokens.length; i++) { tokenList.add(tokens[i].trim()); } } return tokenList; } }