Top "Replace" questions

Replacing is the action of searching a string for a sub-string and replacing it with a different string.

Is there an alternative to string.Replace that is case-insensitive?

I need to search a string and replace all occurrences of %FirstName% and %PolicyAmount% with a value pulled from a …

c# .net string .net-2.0 replace
Can I replace groups in Java regex?

I have this code, and I want to know, if I can replace only groups (not all pattern) in Java …

java regex replace regex-group
Java string replace and the NUL (NULL, ASCII 0) character?

Testing out someone elses code, I noticed a few JSP pages printing funky non-ASCII characters. Taking a dip into the …

java string replace nul
How do I Search/Find and Replace in a standard string?

Is there a way to replace all occurrences of a substring with another string in std::string? For instance: void …

c++ replace std
how to use a regular expression to extract json fields?

Beginner RegExp question. I have lines of JSON in a textfile, each with slightly different Fields, but there are 3 fields …

regex json text replace editpad
JavaScript .replace only replaces first Match

var textTitle = "this is a test" var result = textTitle.replace(' ', '%20'); But the replace functions stops at …

javascript regex replace
Ruby replace string with captured regex pattern

I am having trouble translating this into Ruby. Here is a piece of JavaScript that does exactly what I want …

ruby regex replace
How to replace case-insensitive literal substrings in Java

Using the method replace(CharSequence target, CharSequence replacement) in String, how can I make the target case-insensitive? For example, the …

java string replace substring case-insensitive
How to find and replace all occurrences of a string recursively in a directory tree?

Using just grep and sed, how do I replace all occurrences of: a.example.com with b.example.com within …

sed find grep replace
Python Replace \\ with \

So I can't seem to figure this out... I have a string say, "a\\nb" and I want this to …

python string replace double slash