From e389f376036ca3dc2e82e54befecbc43d0408133 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 24 Apr 2017 09:44:21 +0200 Subject: [PATCH] Addd containsAny method with array paramater. --- src/fr/devinsy/util/strings/StringList.java | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) mode change 100755 => 100644 src/fr/devinsy/util/strings/StringList.java diff --git a/src/fr/devinsy/util/strings/StringList.java b/src/fr/devinsy/util/strings/StringList.java old mode 100755 new mode 100644 index 1732c02..e1d3941 --- a/src/fr/devinsy/util/strings/StringList.java +++ b/src/fr/devinsy/util/strings/StringList.java @@ -538,6 +538,52 @@ public class StringList extends ArrayList implements CharSequence return result; } + /** + * + * @param source + * @return + */ + public boolean containsAny(final String... target) + { + boolean result; + + if (target == null) + { + result = false; + } + else + { + boolean ended = false; + int index = 0; + result = false; + while (!ended) + { + if (index < target.length) + { + String current = target[index]; + + if (this.contains(current)) + { + ended = true; + result = true; + } + else + { + index += 1; + } + } + else + { + ended = true; + result = false; + } + } + } + + // + return result; + } + /** * * @return