Top "Replace" questions

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

How to replace multiple patterns at once with sed?

Suppose I have 'abbc' string and I want to replace: ab -> bc bc -> ab If I …

replace syntax sed
Replace part of a string with another string

Is it possible in C++ to replace part of a string with another string? Basically, I would like to do …

c++ string replace substring std
JavaScript replace/regex

Given this function: function Repeater(template) { var repeater = { markup: template, replace: function(pattern, value) { this.markup = this.markup.replace(pattern, …

javascript regex replace
Replace all particular values in a data frame

Having a data frame, how do I go about replacing all particular values along all rows and columns. Say for …

r dataframe replace
XSLT string replace

I don't really know XSL but I need to fix this code, I have reduced it to make it simpler. …

xslt xpath replace xslt-1.0 xpath-1.0
Regular expression search replace in Sublime Text 2

I'm looking to do search replace with regular expressions in Sublime Text 2. The documentation on this is rather anemic. Specifically, …

regex replace sublimetext2
How to remove line breaks (no characters!) from the string?

This might appear to be a dupe, but rest assured it isn't - I have searched both SO as well …

php html replace line-breaks nl2br
How can I add a string to the end of each line in Vim?

I want to add * to the end of each line in Vim. I tried the code unsuccessfully :%s/\n/*\n/…

regex vim replace match
How to replace an entire line in a text file by line number

I have a situation where I want a bash script to replace an entire line in a file. The line …

bash text replace sed
How to trim a file extension from a String in JavaScript?

For example, assuming that x = filename.jpg, I want to get filename, where filename could be any file name (Let's …

javascript replace substring substr indexof