Questions tagged [replace]

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

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

for example, replacing all 'l' within 'Hello' with 'y', would result in 'Heyyo'.

27903 questions
6
votes
4 answers

How Force replace macro apply on header also

I want to find & replace a text in word document. I created a macro as bellow. Sub Macro1() ActiveDocument.Content.Find.Execute FindText:="#Text1", ReplaceWith:="acca", _ Replace:=wdReplaceAll End Sub It replaced all occurred but not in…
Moh Tarvirdi
  • 685
  • 1
  • 13
  • 25
6
votes
4 answers

Fastest quote-escaping implementation?

I'm working on some code that is normalizing a lot of data. At the end of processing, a number of key="value" pairs is written out to a file. The "value" part could be anything, so at the point of output the values must have any embedded quotes…
Joe
  • 41,484
  • 20
  • 104
  • 125
6
votes
5 answers

Linux delete spaces after a character in a line

In Linux, if I have a file with entries like: My Number is = 1234; #This is a random number Can I use sed or anything else to replace all spaces after '#' with '+', so that the output looks like: My Number is = 1234; #This+is+a+random+number
user1536435
  • 129
  • 8
6
votes
2 answers

Computing all possibilities of replacing one character by another

> magicFunction 'l' '_' "hello world" ["he_lo world", "hel_o world", "hello wor_d"] Is there such a magic function in the standard Prelude or can it be composed easily with other functions? And no, this isn't homework, but still, please don't spend…
fredoverflow
  • 256,549
  • 94
  • 388
  • 662
6
votes
4 answers

Simple Javascript replace with a loop

I'm try to replace all occurances wihtin a string with the array index value as below. var str = '{1}'; var params= []; params.push('Url', 'TitleDisplay'); for (i in params) { var x = /'{' + i + '}'/g; str =…
Alex Guerin
  • 2,336
  • 10
  • 36
  • 53
6
votes
2 answers

jQuery replace marked text

I am trying to replace specific highlighted(marked) text from element. This is how I get the highlighted text so far: var markArea = $('.ElementText textarea').get(0); var text = markArea.value.substring(markArea.selectionStart,…
Zhivko
  • 550
  • 4
  • 16
6
votes
2 answers

ANT "replace" task not expanding properties in "replacetoken" tag

After build, I need to modify an HTML file that points the client to download the new app. I search for a token; replace it with a link and token: