code: public static String replace(String input, String before, String after) {
          if (before.length() == 0) {
              return input;
          }
          return input.replace(before, after);
      }
docs: Returns a string resulting from replacing all occurrences of a "before" substring with an "after" substring.
  The string is processed once and not reprocessed for further replacements.
  
  @param input  the string on which the replacement is to be applied
  @param before the substring to replace
  @param after  the replacement substring
  @return a string with before replaced with after