Skip to content

Commit 58176a7

Browse files
committed
Add containsIgnoreCase method to ArrayUtils for case-insensitive search
1 parent 855a05b commit 58176a7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

SimpleAPI/src/main/java/com/bencodez/simpleapi/array/ArrayUtils.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ public static ArrayList<String> colorize(ArrayList<String> list) {
4040
}
4141
return list;
4242
}
43+
44+
public static boolean containsIgnoreCase(String[] array, String value) {
45+
if (array == null || value == null) {
46+
return false;
47+
}
48+
49+
for (String s : array) {
50+
if (s != null && s.equalsIgnoreCase(value)) {
51+
return true;
52+
}
53+
}
54+
return false;
55+
}
56+
4357

4458
/**
4559
* Colorize.

0 commit comments

Comments
 (0)