Here you can find the source of listify(String s, String prefix, String... ignorelist)
public static String[] listify(String s, String prefix, String... ignorelist)
//package com.java2s; //License from project: Creative Commons License import java.util.ArrayList; import java.util.Scanner; public class Main { public static /* varargs */ String[] listify(String s, String prefix, String... ignorelist) { ArrayList<String> l = new ArrayList<String>(); Scanner m = new Scanner(s); while (m.hasNextLine()) { String b = m.nextLine().trim(); if (b.length() <= 0) continue; l.add(prefix + b);/* w ww . ja v a2 s. c o m*/ } if (ignorelist.length > 0) { ArrayList<String> x = new ArrayList<String>(); for (String a : l) { boolean good = true; for (String bad : ignorelist) { if (!a.contains((CharSequence) bad)) continue; good = false; } if (!good) continue; x.add(a); } l = x; } return l.toArray(new String[0]); } }