If you put an @ before the string, the string becames "literal" without using control characters or escapes (with the backslahses).
So @"hello
ico"
will result in a string with the words "hello" and "nico" separated by a slash and not the words "hello" and "ico" separated by a line feed.
You can also define a string without the @ and with control characters like this: "hello\nico"
which will have the same result. The first backslash is a control character, not an actual value inside the string.
Be aware: if your IDE / debugger shows a value of a string, at will also use the second format to display the text. So the backslash inside the string will be escaped by putting another backslash before it. It looks like the string contains double slashes, but it does not. You can verify this by:
- Checking the length of the string and count the characters.
- Write the value to an output like
Debug.WriteLine
or Console.WriteLine
which will show that string as it is, without the slashes as escapes.
You say: Every time I do it, it becomes a search for src="/
instead of src="/
. Are you sure? I think you are fooled by the IDE / debugger which will show the string with an second backslash, which is just a control character.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…