Top "String-substitution" questions

Substituting string excerpts via sed, awk and other utilities.

Replace specific characters within strings

I would like to remove specific characters from strings within a vector, similar to the Find and Replace feature in …

r regex replace gsub string-substitution
Substitute Function in Excel VBA for cell range

I have to replace one character with another in Excel file. I have used following Replace function, but due to …

vba excel string-substitution
How to use ruby gsub Regexp with many matches?

I have csv file contents having double quotes inside quoted text test,first,line,"you are a "kind" man",thanks …

ruby regex csv gsub string-substitution
sed wildcard substitution

I want to do a substitution based on a wildcard. For example, change all "tenure" to "disposition" only if the …

regex sed grep wildcard string-substitution
R - Remove dashes from a column with phone numbers

I'd like to create a new column of phone numbers with no dashes. I have data that is a mix …

regex r string-substitution
Ruby match first occurrence of string for a gsub replacement

I have a string let's say http://someUrul.com/someController/SOmeAction?SomeQS=http://someOtherUrl and I want to replace the …

ruby regex gsub string-substitution
Shorter way to remove non-characters than gsub(/\d|\W/, "")

my_string = 'Here's the #: 49848! - but will dashes, commas & stars (*) show?' puts src.gsub(/\d|\W/, "") i.e. …

ruby regex string gsub string-substitution