@@ -0,0 +1,1578 @@
+/* Copyright (C) 2006-2017 Patrick G. Durand%0A *%0A *  This program is free software: you can redistribute it and/or modify%0A *  it under the terms of the GNU Affero General Public License as published by%0A *  the Free Software Foundation, either version 3 of the License, or%0A *  (at your option) any later version.%0A *%0A *  You may obtain a copy of the License at%0A *%0A *     https://www.gnu.org/licenses/agpl-3.0.txt%0A *%0A *  This program is distributed in the hope that it will be useful,%0A *  but WITHOUT ANY WARRANTY; without even the implied warranty of%0A *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A *  GNU Affero General Public License for more details.%0A */%0Apackage com.plealog.genericapp.util;%0A%0Apublic class EZUtilities %7B%0A  /**%0A   * Replace all occurrences of a string by another string within a string.%0A   * %0A   * @param str%0A   *          source string%0A   * @param sFind%0A   *          string to find in str%0A   * @param sReplace%0A   *          replacement string%0A   * %0A   * @return a new string or str if sFind was not found.%0A   */%0A  public static String replaceAll(String str, String sFind, String sReplace) %7B%0A    boolean bFound;%0A    int iPos = -1;%0A%0A    String newStr = %22%22;%0A    do %7B%0A      iPos = str.indexOf(sFind, ++iPos);%0A      if (iPos %3E -1) %7B%0A        newStr = newStr + str.substring(0, iPos) + sReplace + str.substring(iPos + sFind.length(), str.length());%0A        str = newStr;%0A        newStr = %22%22;%0A        iPos += (sReplace.length() - 1);%0A        bFound = true;%0A      %7D else %7B%0A        bFound = false;%0A      %7D%0A    %7D while (bFound);%0A    return (str);%0A  %7D%0A%7D%0A

add some utility methods