code: public static String replace(final String value, final String search, final String newValue,
                                   final boolean caseSensitive) {
          validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
          validate(search, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
          if (caseSensitive) {
              return value.replace(search, newValue);
          }
          return Pattern.compile(search, Pattern.CASE_INSENSITIVE).matcher(value)
                  .replaceAll(Matcher.quoteReplacement(newValue));
      }
docs: Replace all occurrences of 'search' value to 'newvalue'. Uses String replace method.
  
  @param value         The input
  @param search        The String to search
  @param newValue      The String to replace
  @param caseSensitive whether search should be case sensitive or not
  @return String replaced with 'newvalue'.