I'm looking for an lib which can search an array of strings with multible search-strings (array). I want to get an int-array of all indexes/matches.
private int[] getIndexArray(String[] pArray, String[] pSearchStrings) {
int[] indexes = new int[0];
for (String str : pArray) {
if (ArrayUtils.contains(pSearchStrings, str))
indexes = ArrayUtils.add(indexes, ArrayUtils.indexOf(pArray, str));
}
return indexes;
}
Is there a better way of doing it?