Hello, how to write quotes ("") to a file (C #)?
Closed due to the fact that the essence of the question is incomprehensible by the participants Igor , Mark Shevchenko , Kromster , 0xdb , cheops 15 Feb '18 at 5:10 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
1 answer
In order to display quotes, you need to use экранированием символов .
Inside lines, characters are escaped using the '\' character.
Let s be the string to be written to the file.
string s="На вывеске магазина красовалась надпись \"Посторонним вход воспрещён\""; The value of the variable s after code execution:
На вывеске магазина красовалась надпись "Посторонним вход воспрещён"
I think it is clear how to use character shielding.
If something is not clear, I will describe it in more detail.
streamWriter.Write("\"");- nick_n_a\"as the most common question. - nick_n_a