Who told you there is
Strings
and
Strings.Chr
? It's probably from your previous re-incarnation.
Do you mean just a character with Unicode code point 34? This is just a quotation mark!
Use:
string script = @"<script language=""javascript""> and so on...";
The symbol "@" means verbose syntax for string literal; in this syntax, quotation mark is escaped by doubling it. In regular syntax, it is escaped as
\"
.
A character from numeric literal meaning its code point can be obtained as
(char)34
. You don't need it here.
Why not simply referring to C# reference instead of your trial-and-error? So counter-productive!
Also, avoid multiple concatenation of strings (
+
). Is is very ineffective because string is
immutable. (Do I have to explain why?) If you concatenate just constants, it would not matter, because it's done in compile time, but if you used function in between, it would be during run-time.
Use
string.Format
instead. If concatenated members are statically unknown, use
System.Text.StringBuilder
.
Avoid any immediate constants, especially strings. Use explicit constants, resources, data files, etc.
—SA