[Dive4elements-commits] [PATCH 3 of 3] StringUtil: Added containsIgnoreCase implementation

Wald Commits scm-commit at wald.intevation.org
Tue Feb 19 11:57:02 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1361271835 -3600
# Node ID bf22086747bc4ecc64b75388ee6efdb48258a863
# Parent  443c173f043ab3da78331b0f6c2ea70c057ef95d
StringUtil: Added containsIgnoreCase implementation.

diff -r 443c173f043a -r bf22086747bc flys-backend/src/main/java/de/intevation/flys/utils/StringUtil.java
--- a/flys-backend/src/main/java/de/intevation/flys/utils/StringUtil.java	Tue Feb 19 12:02:55 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/utils/StringUtil.java	Tue Feb 19 12:03:55 2013 +0100
@@ -819,5 +819,11 @@
         testQuote();
         testStringArray2D();
     }
+
+    /** Check for occurence of needle in hay, converting both to lowercase
+     * to be ignorant of cases. */
+    public static boolean containsIgnoreCase(String hay, String needle) {
+        return hay.toLowerCase().contains(needle.toLowerCase());
+    }
 }
 // end of file


More information about the Dive4elements-commits mailing list