I have a big list<String> that is about 50,000 records. I want an effective way to search for a specific subString in that List and get the Strings that contains that subString.
My code is like this so far:
List<String> result = new ArrayList<>();
if (aCondition) {
for (String file : arg) {
if (file.toLowerCase().contains(tag.toLowerCase())) {
result.add(file);
}
}
}
return result;