Mercurial > dive4elements > river
changeset 5021:bf22086747bc
StringUtil: Added containsIgnoreCase implementation.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 19 Feb 2013 12:03:55 +0100 |
parents | 443c173f043a |
children | 25c180fa6162 |
files | flys-backend/src/main/java/de/intevation/flys/utils/StringUtil.java |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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