Replaces all the old strings with the replacement string.
164580
public static String replace(String str, String oldStr, String replacement) {
		return str.replace(oldStr, replacement);
	}
223126
public static void replace(final StringBuffer sb, final String find, final String replacement) {
		int pos = 0;
		while(pos<sb.length()) {
			pos = sb.indexOf(find, pos);
			if(pos==-1) break;
			sb.replace(pos, pos+find.length(), replacement);
			pos += replacement.length();
		}
	}
806085
public static String replace(final String string, final String find, final String replacement) {
		int pos = string.indexOf(find);
		//System.out.println(string+": "+find+" at "+pos);
		if (pos == -1) return string;
		StringBuilder SB = new StringBuilder();
		int lastpos = 0;
		final int findLen = find.length();
		do {
			SB.append(string, lastpos, pos).append(replacement);
			lastpos = pos + findLen;
			pos = string.indexOf(find, lastpos);
		} while (pos != -1);
		int len = string.length();
		if(lastpos<len) SB.append(string, lastpos, len);
		return SB.toString();
	}
1209553
String replace(String source) {
        if (source == null)
            return null;
        Matcher m = PATTERN.matcher(source);
        StringBuffer sb = new StringBuffer();
        while (m.find()) {
            String var = m.group(1);
            String value = values.getProperty(var);
            String replacement = (value != null) ? replace(value) : "";
            m.appendReplacement(sb, Matcher.quoteReplacement(replacement));
        }
        m.appendTail(sb);
        return sb.toString();
    }
196769
def replace(self, text, pattern=None):
        """"""
        cursor = self.textCursor()
        cursor.beginEditBlock()
        if pattern is not None:
            seltxt = to_text_string(cursor.selectedText())
        cursor.removeSelectedText()
        if pattern is not None:
            text = re.sub(to_text_string(pattern),
                          to_text_string(text), to_text_string(seltxt))
        cursor.insertText(text)
        cursor.endEditBlock()
142722
private String getReplaceChars(String replaceChar,int length){
		String resultReplace = replaceChar;
		for(int i = 1 ; i < length ; i++){
			resultReplace += replaceChar;
		}
		
		return resultReplace;
	}
276814
private static String replace(String source, char oldChar, String newString) {
        StringBuilder StringBuilder = new StringBuilder(source.length());
        for (int i = 0; i < source.length(); i++) {
            char c = source.charAt(i);
            if (c == oldChar) {
                StringBuilder.append(newString);
            } else {
                StringBuilder.append(c);
            }
        }
        return StringBuilder.toString();
    }
1320012
def replace_all(text, dic):
    """"""

    for i, j in dic.iteritems():
        text = text.replace(i, j)
    return text
724917
function replaceString(content, search, replace) {
        var index = 0;

        do {
          index = content.indexOf(search, index);

          if (index !== -1) {
            content = content.substring(0, index) + replace + content.substr(index + search.length);
            index += replace.length - search.length + 1;
          }
        } while (index !== -1);

        return content;
      }
664029
def replace(input, **params):
    
    PARAM_REPLACE_LIST = 'replace'
    REPLACE_FIELD = 'field'
    REPLACE_FIND_VALUE = 'value.to_find'
    REPLACE_WITH_VALUE = 'value.replace_with'

    replace_list = params.get(PARAM_REPLACE_LIST)
    for row in input:
        for replace in replace_list:
            if row[replace[REPLACE_FIELD]] == replace[REPLACE_FIND_VALUE]:
                row[replace[REPLACE_FIELD]] = replace[REPLACE_WITH_VALUE]
    return input
1239240
public static StringBuilder replace(StringBuilder sb, Map<String,String> ht)
    {
        for (Object strKey : ht.keySet())
        {
            sb = Utility.replace(sb, (String)strKey, (String)ht.get(strKey));            
        }
        return sb;
    }
535814
def replace_strings_in_list(array_of_strigs, replace_with_strings):
    ""
    potentially_nested_list = [replace_with_strings.get(s) or s for s in array_of_strigs]
    return list(flatten(potentially_nested_list))
686550
def _replace(self, data, replacements):
        
        for find, repl in replacements:
            data = data.replace(find, repl)
        return data
1064058
public static void replaceAll(StringBuffer haystack, String needle, String newNeedle, int interval) {
		if (needle == null) {
			throw new IllegalArgumentException("string to replace can not be empty");
		}
		int idx = haystack.indexOf(needle);
		int nextIdx = -1;
		int processedChunkSize = idx;
		int needleLength = needle.length();
		int newNeedleLength = newNeedle.length();
		while (idx != -1/* && idx < haystack.length()*/) {
			if (processedChunkSize >= interval) {
				haystack.replace(idx, idx + needleLength, newNeedle);
				nextIdx = haystack.indexOf(needle, idx + newNeedleLength);
				processedChunkSize = nextIdx - idx;//length of replacement is not included
				idx = nextIdx;
			}
			else {
				nextIdx = haystack.indexOf(needle, idx + newNeedleLength);
				processedChunkSize += nextIdx - idx;
				idx = nextIdx;
				if (newNeedleLength == 0) {
					return;
				}
			}
		}
	}
555547
def apply_replacements(output)
      replace_patterns.reduce(output) do |output, replacement_pattern|
        replacement_pattern.replace(output)
      end
    end
1329139
function str_replace(names, values, str) {
  names.forEach((name, idx) => {
    str = str.replace(names[idx], values[idx]);
  });
  return str;
}
367029
public void replaceField(String sourceField, String targetField, String oldString, String newString) {
        TransformationStep step = new TransformationStep();
        step.setSourceFields(sourceField);
        step.setTargetField(targetField);
        step.setOperationParameter(TransformationConstants.REPLACE_OLD_PARAM, oldString);
        step.setOperationParameter(TransformationConstants.REPLACE_NEW_PARAM, newString);
        step.setOperationName("replace");
        steps.add(step);
    }