Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.text;
 
import static base.text.StringHelper.chomp;
public class TagsToArray {
	public static String[] tagsToArray(String items) {
		List<Stringtags = new LinkedList<>();
		for(String item : items.split("[ \t,]+")) {
			item = chomp(item);
			if(item.length() > 0) {
				tags.add(item);
			}
		}
		return tags.toArray(new String[]{});
	}
	public static String[] tagsWithInnerSpacesToArray(String items) {
		List<Stringtags = new LinkedList<>();
		for(String item : items.split("[\t,]+")) {
			item = chomp(item);
			if(item.length() > 0) {
				tags.add(item);
			}
		}
		return tags.toArray(new String[]{});
	}
New to GrepCode? Check out our FAQ X