tagged [replace]
How to use operator '-replace' in PowerShell to replace strings of texts with special characters and replace successfully
How to use operator '-replace' in PowerShell to replace strings of texts with special characters and replace successfully I have a script where I am basically doing a find and replace on several strin...
- Modified
- 13 Jul at 13:41
String replace a Backslash
String replace a Backslash How can I do a string replace of a back slash. In the above String I want to replace "\/" with a "/"; I get the Source String from a third party, therefore I have control ov...
- Modified
- 8 Apr at 14:18
JavaScript: replace last occurrence of text in a string
JavaScript: replace last occurrence of text in a string See my code snippet below: ``` var list = ['one', 'two', 'three', 'four']; var str = 'one two, one three, one four, one'; for ( var i = 0; i
- Modified
- 25 Apr at 17:4
Regular expression search replace in Sublime Text 2
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](http://docs.sublimetext.info/en/latest/sear...
- Modified
- 25 May at 15:33
how to use a regular expression to extract json fields?
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 I want to extract for ...
JavaScript replace/regex
JavaScript replace/regex Given this function: How do I make `this.markup.replace()` replace globally? Here's the problem. If I use it like this: ``` alert(
- Modified
- 30 Jun at 15:58
How do I replace a character in a string in Java?
How do I replace a character in a string in Java? Using Java, I want to go through the lines of a text and replace all ampersand symbols (`&`) with the XML entity reference `&`. I scan the lines o...
Regex : how to get words from a string (C#)
Regex : how to get words from a string (C#) My input consists of user-posted strings. What I want to do is create a dictionary with words, and how often they’ve been used. This means I want to parse a...
Finding and replacing elements in a list
Finding and replacing elements in a list I have to search through a list and replace all occurrences of one element with another. So far my attempts in code are getting me nowhere, what is the best wa...
PHP remove commas from numeric strings
PHP remove commas from numeric strings In PHP, I have an array of variables that are ALL strings. Some of the values stored are numeric strings with commas. What I need: A way to trim the commas from...
Replace and overwrite instead of appending
Replace and overwrite instead of appending I have the following code: where I'd like to replace the old content that's in the file with the new content
How to swap text based on patterns at once with sed?
How to swap text based on patterns at once with sed? Suppose I have 'abbc' string and I want to replace: - - If I try two replaces the result is not what I want: So what sed command can I use to repla...
UPDATE and REPLACE part of a string
UPDATE and REPLACE part of a string I've got a table with two columns, `ID` and `Value`. I want to change a part of some strings in the second column. Example of Table: Now the `123\` in the `Valu
- Modified
- 18 Sep at 21:9
string IndexOf and Replace
string IndexOf and Replace I have just faced this problem today and wonder if someone has any idea about why does this test may fail (depending on culture). The aim is to check if the test text contai...
How do I find and replace all occurrences (in all files) in Visual Studio Code?
How do I find and replace all occurrences (in all files) in Visual Studio Code? I can't figure out how to find and replace all occurrences of a word in different files using Visual Studio Code version...
- Modified
- 10 Jul at 10:32
How to replace the text between two characters in c#
How to replace the text between two characters in c# I am bit confused writing the regex for finding the Text between the two delimiters and replace the text with another text in c#,how to replace? I ...
String.Replace() vs. StringBuilder.Replace()
String.Replace() vs. StringBuilder.Replace() I have a string in which I need to replace markers with values from a dictionary. It has to be as efficient as possible. Doing a loop with a string.replace...
Find and Replace Inside a Text File from a Bash Command
Find and Replace Inside a Text File from a Bash Command What's the simplest way to do a find and replace for a given input string, say `abc`, and replace with another string, say `XYZ` in file `/tmp/f...
- Modified
- 15 Jan at 11:47
C# Replacing part of string by start and end position
C# Replacing part of string by start and end position I have a string and I want to replace a part of it. The tricky part is that that I can't use Regex.replace, because I only know the start and end ...
Is there an alternative to string.Replace that is case-insensitive?
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 database. The...
How can I remove a character from a string using JavaScript?
How can I remove a character from a string using JavaScript? I am so close to getting this, but it just isn't right. All I would like to do is remove the character `r` from a string. The problem is, t...
- Modified
- 11 Dec at 07:58
How to replace NaN value with zero in a huge data frame?
How to replace NaN value with zero in a huge data frame? I tried to replace `NaN` values with zeros using the following script: The NaN value was showing to be zero but when I typed in the name of the...