From 026772bea2bc0b8b6fbb4fcbf96d576e2eacfc0d Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Thu, 28 Dec 2017 05:08:36 +0100 Subject: [PATCH] Fixed last new methods. --- src/fr/devinsy/util/strings/StringsUtils.java | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/src/fr/devinsy/util/strings/StringsUtils.java b/src/fr/devinsy/util/strings/StringsUtils.java index 8b93c1e..a4f522d 100644 --- a/src/fr/devinsy/util/strings/StringsUtils.java +++ b/src/fr/devinsy/util/strings/StringsUtils.java @@ -117,7 +117,31 @@ public class StringsUtils { boolean result; - result = new StringList(strings).contains(token); + boolean ended = false; + int index = 0; + result = false; + while (!ended) + { + if (index < strings.length) + { + String current = strings[index]; + + if (StringUtils.contains(token, current)) + { + ended = true; + result = true; + } + else + { + index += 1; + } + } + else + { + ended = true; + result = false; + } + } // return result; @@ -136,7 +160,31 @@ public class StringsUtils { boolean result; - result = new StringList(strings).containsIgnoreCase(token); + boolean ended = false; + int index = 0; + result = false; + while (!ended) + { + if (index < strings.length) + { + String current = strings[index]; + + if (StringUtils.containsIgnoreCase(token, current)) + { + ended = true; + result = true; + } + else + { + index += 1; + } + } + else + { + ended = true; + result = false; + } + } // return result;