tagged [replace]

Replace part of a string with another string

Replace part of a string with another string How do I replace part of a string with another string using the ?

4 Jul at 20:52

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

20 May at 14:59

Fastest method to replace all instances of a character in a string

Fastest method to replace all instances of a character in a string What is the fastest way to replace all instances of a string/character in a string in JavaScript? A `while`, a `for`-loop, a regular ...

5 Sep at 16:43

Best way to replace multiple characters in a string?

Best way to replace multiple characters in a string? I need to replace some characters as follows: `&` ➔ `\&`, `#` ➔ `\#`, ... I coded as follows, but I guess there should be some better way. Any hint...

4 Sep at 15:7

c# replace \" characters

c# replace \" characters I am sent an XML string that I'm trying to parse via an XmlReader and I'm trying to strip out the `\"` characters. I've tried plus several other ways. Any ideas?

25 Dec at 14:45

C# hexadecimal value 0x12, is an invalid character

C# hexadecimal value 0x12, is an invalid character I am loading a lot of xml documents and some of them return errors like "hexadecimal value 0x12, is an invalid character" and there are different cha...

10 Jan at 19:46

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)

18 Sep at 14:49

Remove a fixed prefix/suffix from a string in Bash

Remove a fixed prefix/suffix from a string in Bash I want to remove the prefix/suffix from a string. For example, given: How do I get the following result?

C# Trim() vs replace()

C# Trim() vs replace() In a C# `string` if we want to replace `" "` in a string to `string.empty`, is it fine to use `stringValue.Trim()` or `stringValue.replace(" ", string.empty)`. Both serve the sa...

14 Aug at 16:7

How can I do a recursive find/replace of a string with awk or sed?

How can I do a recursive find/replace of a string with awk or sed? How do I find and replace every occurrence of: with in every text file under the `/home/www/` directory tree recursively?

1 Nov at 20:5