tagged [replace]
How to replace text in a string column of a Pandas dataframe?
How to replace text in a string column of a Pandas dataframe? I have a column in my dataframe like this: and I want to replace the `,` comma with `-` dash. I'm currently using this method but nothing ...
How to find and replace all occurrences of a string recursively in a directory tree?
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: with within a text file under the `/home/user/` direc...
Multiple REPLACE function in Oracle
Multiple REPLACE function in Oracle I am using the `REPLACE` function in oracle to replace values in my string like; So this is OK to replace one value, but what about 20+, should I use 20+ `REPLACE` ...
Alternative to String.Replace
Alternative to String.Replace So I was writing some code today that basically looks like this: ``` string returnString = s.Replace("!", " ") .Replace("@", " ") .Replace("#", " ") .Re...
What would be the fastest way to remove Newlines from a String in C#?
What would be the fastest way to remove Newlines from a String in C#? I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline ...
Is this possible with regular expressions?
Is this possible with regular expressions? Something like this: The idea is that `a` will get replaced with `e`, `b` with `f`, `c` with `g` and so on. Ideally, this should be language independent. If ...
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 "...
php Replacing multiple spaces with a single space
php Replacing multiple spaces with a single space I'm trying to replace multiple spaces with a single space. When I use `ereg_replace`, I get an error about it being deprecated. Is there an identical ...
- Modified
- 15 Sep at 08:7
Replace sequence of bytes in binary file
Replace sequence of bytes in binary file What is the best method to replace sequence of bytes in binary file to the same length of other bytes? The binary files will be pretty large, about 50 mb and s...
- Modified
- 29 Jun at 18:48
MySQL string replace
MySQL string replace I have a column containing urls (id, url): I'd like to change the word "updates" to "news". Is it possible to do this with a scrip
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
C# replace string in string
C# replace string in string Is it possible to replace a substring in a string without assigning a return value? I have a string: And I want to replace the substring `[REPLACE]` with something else: Th...
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
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
How to search for occurrences of more than one space between words in a line
How to search for occurrences of more than one space between words in a line How to search for occurrences of more than one space between words in a line All the above are valid matches for this regex...
Replace specific characters within strings
Replace specific characters within strings I would like to remove specific characters from strings within a vector, similar to the feature in Excel. Here are the data I start with: ``` group
- Modified
- 21 Feb at 00:14
Can I replace groups in Java regex?
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 regex. Code: ``` //... Pattern p = Pattern.compile("(\\d).*(\\d)"); S...
- Modified
- 21 Nov at 06:45
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 to Replace by pattern with Regex in C#
How to Replace by pattern with Regex in C# I have a text, the text contains char sequence which begins with # and ends with ="" characters. Between the # and ="" characters just exists alphanumeric ch...
- Modified
- 24 Oct at 07:20
How to replace multiple substrings of a string?
How to replace multiple substrings of a string? I would like to use the .replace function to replace multiple strings. I currently have but would like to have something like although that does not fe...
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) {...
Replace all values in a matrix <0.1 with 0
Replace all values in a matrix
How to find and replace with regex in excel
How to find and replace with regex in excel I have an excel file with 1 column and multiple rows. The rows contain various text, here's an example: I want to replace "texts are *" where * is anything ...