I want to have a program that will be able to write to the file:
addr_new = serverInfo.REGION_DICT[0][serverNum]["channel"][serverChannel]["ip"]
, but must ignore the characters “” in the text
My restult: Visual studio does not ignores characters “” in string and wants strings like IP etc.. thx for help
Sry for my english
There is my Program:
string path = System.IO.Directory.GetCurrentDirectory()+ "logininfo.py";
string[] lines = {
"import serverInfo"
, "serverNum=1"
, "serverChannel=1"
, "addr_new = serverInfo.REGION_DICT[0][serverNum]["channel"][serverChannel]["ip"]"};
System.IO.StreamWriter file = new System.IO.StreamWriter(path);
file.WriteLine(lines);
file.Close();
I almost forgot I want more lines, this program is trimmed
You can escape those characters with a slash:
or use a @-quoted string and use
""instead of"like so: