0

i like to assign html codes to String variable

  Dim code As String
  code= "  <meta http-equiv="Content-Type" content="text/html; charset=windows-1254">  "

i think i am getting this error because of double Quotation marks
"character constant must contain exactly one character."

how can i assign it to a string?

Edited by ulasoc

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by ulasoc
0

or:

Also, you can use this if you don't want to use the System.Web assembly:

var encoded = System.Security.SecurityElement.Escape(unencoded)

Per this article, the difference between System.Security.SecurityElement.Escape() and System.Web.HttpUtility.HtmlEncode() is that the former also encodes apostrophe (') characters.

Edited by Mitja Bonca

0

If you want to use the format you gave in the OP you just have to convert the embedded double quotes to double double quotes as follows

code= " <meta http-equiv=""Content-Type"" content=""text/html; charset=windows-1254""> "

I may be mistaken on this but you also may be able to replace the embedded quotes with single quotes as in

code= " <meta http-equiv='Content-Type' content='text/html; charset=windows-1254'> "
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.