tagged [replace]
jQuery remove special characters from string and more
jQuery remove special characters from string and more I have a string like this: What I would like to do is removing all special characters from the above string and replace spaces and in case they ar...
- Modified
- 23 Jan at 22:51
Turning a single quote into an escaped single quote within a string
Turning a single quote into an escaped single quote within a string It pains me to ask this, but, for some reason I have not been able to get this to work (it's late in the day, yes, that's my excuse)...
jQuery if div contains this text, replace that part of the text
jQuery if div contains this text, replace that part of the text Like the title says, I want to replace a specific part of the text in a div. The structure looks like this: And I want to replace only "...
How to remove any URL within a string in Python
How to remove any URL within a string in Python I want to remove all URLs inside a string (replace them with "") I searched around but couldn't really find what I want. Example: I want the result to b...
- Modified
- 4 Jul at 15:30
Java Replace Character At Specific Position Of String?
Java Replace Character At Specific Position Of String? I am trying to replace a character at a specific position of a string. For example: replace string position #2 (i) to another letter "k" How woul...
Replace given value in vector
Replace given value in vector I'm looking for a function which will replace all occurrences of one value with another value. For example I'd like to replace all zeros with ones. I don't want to have t...
Want to remove the double quotes from the strings
Want to remove the double quotes from the strings I saw some questions here related to removing double quotes. But it not solved my Issue. They told to use Replace or Trim functions. I used but the pr...
How to use named groups when performing a Regex.Replace()
How to use named groups when performing a Regex.Replace() How do I use named captures when performing Regex.Replace? I have gotten this far and it does what I want but not in the way I want it: ``` [T...
Removing spaces from string
Removing spaces from string I'm trying to remove all the spaces from a string derived from user input, but for some reason it isn't working for me. Here is my code. ``` public void onClick(View src) {...
jQuery - replace all instances of a character in a string
jQuery - replace all instances of a character in a string This does not work and I need it badly always gets it's always replacing for the first instance only, but I need it to work for all + symbols.
str_replace with array
str_replace with array I'm having some troubles with the PHP function `str_replace` when using arrays. I have this message: And I am trying to use `str_replace` like this: ``` $new_message = str_repla...
- Modified
- 5 Dec at 03:29
Quickly replace first line of large file
Quickly replace first line of large file I have many large csv files (1-10 gb each) which I'm importing into databases. For each file, I need to replace the 1st line so I can format the headers to be ...
Replace only some groups with Regex
Replace only some groups with Regex Let's suppose I have the following regex: and I want to replace, using C#, the Group 1 `(\d+)` with `AA`, to obtain: Now I'm replacing it using: But I don't really ...
Replacing double quote with a single quote
Replacing double quote with a single quote I have the following string in c#: `ptFirstName` returns: `"John"` I wish to convert this to `'John'` I have tried numerous variations of the following, but ...
How can I add a string to the end of each line in Vim?
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
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 can I get at the matches when using preg_replace in PHP?
How can I get at the matches when using preg_replace in PHP? I am trying to grab the capital letters of a couple of words and wrap them in span tags. I am using [preg_replace](http://php.net/manual/en...
- Modified
- 29 Jul at 22:9
Replacing multiple characters in a string in c# by a one liner
Replacing multiple characters in a string in c# by a one liner What I'm wondering of is whether it is possible to replace multiple characters in a string (lets say, the &, | and $ characters for examp...
How do I perform a Perl substitution on a string while keeping the original?
How do I perform a Perl substitution on a string while keeping the original? In Perl, what is a good way to perform a replacement on a string using a regular expression and store the value in a differ...
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...
How to replace part of string by position?
How to replace part of string by position? I have this string: `ABCDEFGHIJ` I need to replace from position 4 to position 5 with the string `ZX` It will look like this: `ABCZXFGHIJ` But not to use wit...
Notepad++ - How can I replace blank lines
Notepad++ - How can I replace blank lines I have a text file with a thousand lines of numbers like so: As you can see there is a blank line in between each number that I want to remove so that I have ...
- Modified
- 3 Sep at 00:1
Lua String replace
Lua String replace How would i do this? I got this: which should return "Hi", but it grabs the caret character as a pattern character What would be a work around for this? (must be done in gsub)
- Modified
- 18 Sep at 14:49
How can I use mySQL replace() to replace strings in multiple records?
How can I use mySQL replace() to replace strings in multiple records? We have a database that has a bunch of records with some bad data in one column, in which an embedded editor escaped some stuff th...