diff --git a/src/fr/devinsy/util/ToolBox.java b/src/fr/devinsy/util/ToolBox.java index 33a649c..58cdf9a 100644 --- a/src/fr/devinsy/util/ToolBox.java +++ b/src/fr/devinsy/util/ToolBox.java @@ -169,6 +169,52 @@ public class ToolBox return result; } + /** + * + * @param string + * @param targets + * @return + */ + public static boolean matchesAny(final String string, final String... targets) + { + boolean result; + + if ((string == null) || (targets == null)) + { + result = false; + } + else + { + // + boolean ended = false; + int index = 0; + result = false; + while (!ended) + { + if (index < targets.length) + { + if (StringUtils.equals(string, targets[index])) + { + ended = true; + result = true; + } + else + { + index += 1; + } + } + else + { + ended = true; + result = false; + } + } + } + + // + return result; + } + /** * * @return