tags:

views:

113

answers:

2

I want to put these strings in a list, how do I do that? The hold up is the double "", found in the first two lines, how can I work around this?

scriptTxt = new string[]
{
    "#$language = "VBScript"",
    "#$interface = "1.0"",
    "crt.Screen.Synchronous = True",
    "Sub Main"
};
+5  A: 
scriptTxt = new string[]
{
    "#$language = \"VBScript\"",
    "#$interface = \"1.0\"",
    "crt.Screen.Synchronous = True",
    "Sub Main"
};

Or

scriptTxt = new string[]
{
    @"#$language = ""VBScript""",
    @"#$interface = ""1.0""",
    "crt.Screen.Synchronous = True",
    "Sub Main"
};
Quintin Robinson
You'll need another @ sign on the second string as the 1.0 has quotes as well.
Brandon
+1  A: 

Escape the quotes with a backslash. (An apostrophe is a ')

scriptTxt = new string[]
{
    "#$language = \"VBScript\"",
    "#$interface = \"1.0\"",
    "crt.Screen.Synchronous = True",
    "Sub Main"
};
Brandon