### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.workbench Index: Eclipse UI/org/eclipse/ui/internal/util/Util.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/util/Util.java,v retrieving revision 1.41 diff -u -r1.41 Util.java --- Eclipse UI/org/eclipse/ui/internal/util/Util.java 15 Nov 2006 17:27:09 -0000 1.41 +++ Eclipse UI/org/eclipse/ui/internal/util/Util.java 16 Nov 2006 18:45:07 -0000 @@ -750,4 +750,41 @@ return splitStr; } + + /** + * Foundation replacement for String.replaceAll(*). + * + * @param src the starting string. + * @param find the string to find. + * @param replacement the string to replace. + * @return The new string. + * @since 3.3 + */ + public static String replaceAll(String src, String find, String replacement) { + final int len = src.length(); + final int findLen = find.length(); + + int idx = src.indexOf(find); + if (idx < 0) { + return src; + } + + StringBuffer buf = new StringBuffer(); + int beginIndex = 0; + while (idx != -1 && idx < len) { + buf.append(src.substring(beginIndex, idx)); + buf.append(replacement); + + beginIndex = idx + findLen; + if (beginIndex < len) { + idx = src.indexOf(find, beginIndex); + } else { + idx = -1; + } + } + if (beginIndex