replace Questions
3
I would like to replace two carriage returns (\n\n) with a carriage return and a tab (\n\t) in Google Docs (regular document NOT a spreadsheet). If I enter \n\t in replace with the simple text, as ...
Coheir asked 28/11, 2016 at 23:22
4
Solved
I wanted to make a PHP function that would make text bold between double asterisks, and italic between one asterisk, (quite like the editor on Stack Overflow).
The same rules apply, if there's a sp...
5
Solved
It is a simple question. I have a list of country names. However, I wanted to change few names with correct names. So, I have two more vectors; one with names to be changed, and second with correct...
4
Solved
This is my file.txt:
Egg and Bacon;
Egg, sausage and Bacon
Egg and Spam;
Spam Egg Sausage and Spam;
Egg, Bacon and Spam;
I wanna convert the newLine '\n' to ' $ '. I just used:
f = open(fileN...
Flagstone asked 25/3, 2015 at 9:4
3
I have dictionary and created Pandas using
cars = pd.DataFrame.from_dict(cars_dict, orient='index')
and
sorted the index (columns in alphabetical order
cars = cars.sort_index(axis=1)
After sortin...
8
Solved
I have an excel file with 1 column and multiple rows.
The rows contain various text, here's an example:
texts are home
texts are whatever
dafds
dgretwer
werweerqwr
texts are 21412
texts are 34634...
6
Solved
Since str_replace() matches :Name two times in :Name :Name_en, I want to match the results for the whole word only. I wanted to switch to preg_replace() because of this answer.
$str = ":Name :...
Nutt asked 13/3, 2012 at 10:53
4
Solved
I am editing an e-book document with a lot of unnecessary markup. I have a number of sections in the text with code similar to this:
<i>Some text here</i>
I am trying to run a regex ...
3
Solved
The column [PAYOFF DATE] has some blank values and some values in mm/dd/yy format.
I have to replace '/' with '-' and return the date as yyyy-mm-dd. The below query is doing it. The problem is tha...
Malinowski asked 9/4, 2014 at 20:20
4
Solved
Is there an equivalent of Python str.format in PHP?
In Python:
"my {} {} cat".format("red", "fat")
All I see I can do in PHP natively is by naming the entries and using str_replace:
str_replac...
Perrins asked 19/5, 2013 at 6:35
5
Solved
I'm currently working on a big svg sprite.
The diffrent images are always 2000px apart.
What I have is:
<g transform="translate(0,0)">
<g transform="translate(0,2000)">
<g transfor...
Germainegerman asked 15/10, 2019 at 10:36
9
Solved
I have several configuration files nested like such:
C:\Projects\Project_1\project1.config
C:\Projects\Project_2\project2.config
In my configuration I need to do a string replace like such:
<...
Stacee asked 14/5, 2010 at 21:36
9
Solved
Let's suppose I have the following regex:
-(\d+)-
and I want to replace, using C#, the Group 1 (\d+) with AA, to obtain:
-AA-
Now I'm replacing it using:
var text = "example-123-example";
va...
29
Solved
For example, assuming that x = filename.jpg, I want to get filename, where filename could be any file name (Let's assume the file name only contains [a-zA-Z0-9-_] to simplify.).
I saw x.substring(...
Fasto asked 22/11, 2010 at 21:24
3
Solved
I want to make python ignore chars it can't encode, by simply replacing them with the string "<could not encode>".
E.g, assuming the default encoding is ascii, the command
'%s is the word'%...
6
Solved
This question is motivated by an answer I gave a while ago.
Let's say I have a dataframe like this
import numpy as np
import pandas as pd
df = pd.DataFrame({'a': [1, 2, np.nan], 'b': [3, np.nan,...
Sibley asked 13/12, 2017 at 8:16
3
Solved
I have a string
vec = c('blue','red','flower','bee')
I want to convert different strings into the same in one line instead of seperately
i.e. i could gsub blue and gsub red to make them both spe...
3
Solved
I want to pass a function call(which returns a string) as a replacement string to Powershell's replace function such that each match found is replaced with a different string.
Something like -
$...
Canvass asked 17/11, 2011 at 6:34
7
Solved
Trying to replace all occurrences of an @mention with an anchor tag, so far I have:
$comment = preg_replace('/@([^@ ])? /', '<a href="/$1">@$1</a> ', $comment);
Take the foll...
5
Solved
The following code is a line in an xml file:
<appId>455360226</appId>
How can I replace the number between the 2 tags with another number using ruby?
3
Solved
I'm trying to write a markdown document that contains something like a centrally specified placeholder variable which allows to propagate a certain text snippet to different locations of the docume...
Fleabane asked 15/2, 2021 at 7:27
5
Solved
What is the best way to add a specific value or values to an array?
<?php
$myarray = array("test", "test2", "test3");
$myarray = array_addstuff($myarray, " &qu...
19
Solved
How do I replace part of a string with another string using the standard C++ libraries?
QString s("hello $name"); // Example using Qt.
s.replace("$name", "Somename");
...
23
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, there is more than one instance of r in the string.
However, ...
Peterkin asked 29/3, 2012 at 20:24
5
Solved
I need to open a text file and replace a string. I need this
Old String: <span id="$msgid" style="display: block;">
New String: <span id="$msgid" style="display: none;">
This is what...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.