I need to use double quotes in a string that uses the @ symbol. Using double quotes is breaking the string. I tried escaping with \, but that doesn't work. Ideas?
Asked
Active
Viewed 2.0k times
3 Answers
15
You double the quotes inside a verbatim string to get a quote character.
This makes your given sample:
(@"PREFIX rdfs: <" + rdfs + @">
SELECT ?s ?p ?o
WHERE { ?s ?p rdfs:Literal }
{?s rdfs:label ""date""}");

GBegen
- 6,107
- 3
- 31
- 52
0
You can use this if you want to write into a file :
string myString = @"Here is my ""quoted""text.";
myString.Replace(@"""",@""");

Cb_M
- 197
- 1
- 2
- 10