-1
I am creating a simple unit test that compares two strings and would like to use the marker @
to leave the contents of a string formatted in several lines as follows:
var esperado = @"123|teste|teste|\"GET / algunNomeDeRquivo.txt HTTP / 1.1\"|100.2
453| 404| MISS | \"POST /myImages HTTP/1.1\" | 999
199 | 404 | MISS | \"GET /testte HTTP/1.1" | 999
312 | 201| TESTE| "GET /teste.txt HTTP/1.1\" | 999";
But when I add the marker @
it recognizes the quotes inside the string as the end marker of the string. Is there any way to keep the @
in strings that have double quotes in their contents?
only put two
""
...@"123|teste|teste|""GET..."
– Rovann Linhalis
You can also use Stringbuilder, to separate by lines to organize, for example: Stringbuilder expected = new Stringbuilder(); expected.Append("123|test|"GET / someName.HTTP file.txt / 1.1" |100.2");
– Gean Miguel