Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/StringUtils.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/StringUtils.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/StringUtils.java
index 939c61d04..c9c09a179 100644
--- a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/StringUtils.java
+++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/StringUtils.java
@@ -233,4 +233,14 @@ public final class StringUtils {
return string;
return string.substring(0, index) + replace + replaceAll(string.substring(index + target.length()), target, replace);
}
+
+ /**
+ * @see StringUtils#replaceAll(String, String, String) but case insensitive
+ */
+ public static String replaceAllIgnoreCase(String string, String target, String replace) {
+ final int index = string.toLowerCase().indexOf(target.toLowerCase());
+ if (index == -1)
+ return string;
+ return string.substring(0, index) + replace + replaceAllIgnoreCase(string.substring(index + target.length()), target, replace);
+ }
}

Back to the top