Answers for "sed replace character"

PHP
5

php replace return character

$string = str_replace("\n", "", $string);
$string = str_replace("\r", "", $string);
Posted by: Guest on May-14-2020
13

linux replace string in all files

sed -i 's/old-text/new-text/g' input.txt
Posted by: Guest on March-31-2020
14

sed replace in file

sed -i 's/foo/bar/g' hello.txt
Posted by: Guest on March-01-2020
2

sed replace with variable

Just concatenate var '"$var"' to replace values string in sed command:
$ sed -i 's/string_to_replace/'"$var"'/g' file_to_replace.txt
Posted by: Guest on November-03-2020
2

replace using sed

#on my mac
sed -i -e 's/old-text/new-text/g' text.txt
Posted by: Guest on November-26-2020
5

java string remove character

String str = "abcdDCBA123";
String strNew = str.replace("a", ""); // strNew is 'bcdDCBA123'
Posted by: Guest on July-15-2020

Browse Popular Code Answers by Language