Here you can find the source of stringToList(String s)
private static ArrayList<String> stringToList(String s)
//package com.java2s; /*/*w ww . ja va 2 s . com*/ The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL. The Original Code is the DoPE Pharmacoepidemiology Toolbox. The Initial Developer of the Original Code is the Brigham and Women's Hospital Division of Pharmacoepidemiology. Contributor(s): Jeremy A. Rassen <jrassen@post.harvard.edu> */ import java.util.ArrayList; public class Main { private static ArrayList<String> stringToList(String s) { ArrayList<String> l = new ArrayList<String>(); if ((s != null) && (s.length() > 0)) { String[] stringTokens = s.split("\\s"); for (int i = 0; i < stringTokens.length; i++) l.add(stringTokens[i].toUpperCase()); } return l; } }