I’m having trouble using gsub correctly:
Given this code:
"replace me".gsub(/replace me/, "this \\0 is a test")
The result is:
"this replace me is a test"
But what I am expecting is:
"this \0 is a test"
How do I use gsub to get the result I want?
Escape it with another backslash so that
gsubwill know you want"\\0".(Edit) if by
"\0"you meant the byte0x00, do this: