2 * Created on 28.06.2003
5 package net.sourceforge.phpdt.externaltools.util;
8 * some string utilities
11 public class StringUtil {
14 * Replace each substring of str which matches findStr with replaceStr
17 * the string the substrings should be replaced in
19 * the substring to be replaced
22 * @return the resultstring
24 public static final String replaceAll(String str, String findStr,
26 StringBuffer buf = new StringBuffer();
30 while ((indexOf = str.indexOf(findStr, lastindex)) != -1) {
31 buf.append(str.substring(lastindex, indexOf)).append(replaceStr);
32 lastindex = indexOf + findStr.length();
34 buf.append(str.substring(lastindex));
35 return buf.toString();