1

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" }; 

2 Answers 2

5
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" }; 
Sign up to request clarification or add additional context in comments.

1 Comment

You'll need another @ sign on the second string as the 1.0 has quotes as well.
1

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

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.