code: public static String replace(String str, String[] search, String[] replace) {
          if (str == null || search == null || replace == null) {
              return str;
          }
          StringBuilder sb = new StringBuilder(str);
          int loop = (search.length <= replace.length) ? search.length : replace.length;
          int start = 0;
          int end;
          int searchLen;
          int replaceLen;
          for (int i = 0; i < loop; i++) {
              if (search[i] == null || replace[i] == null) {
                  continue;
              }
              searchLen = search[i].length();
              replaceLen = replace[i].length();
              while (true) {
                  if (sb.length() == 0) {
                      break;
                  }
                  start = sb.indexOf(search[i], start + replaceLen);
                  if (start == -1) {
                      break;
                  }
                  end = start + searchLen;
                  sb.replace(start, end, replace[i]);
              }
          }
          return sb.toString();
      }
docs: Replace all occurrences of a substring within a string with another string.
  
  @param str {@code String} to examine
  @param search {@code String} array to replace
  @param replace {@code String} array to insert
  @return a {@code String} with the replacements