Printing double quotes in ASPIn ASP VBScript we can't print a double quote inside at output statement. We have to take special care to display a double quote inside or outside a string.(In PHP we can easily escape the double quote by using escape character ( like \" ) ). Here are some examples to display double quotes in ASP We can use chr(34) to print a double quote to the screen Response.Write chr(34)( Try different values of chr to display different characters to the screen )We can use " to print double quotes to the screen Response.Write """Some time within a string we will have double quotes to print. Here to print one double quote we will escape it by one more double quote so two double quotes are to be used. Read this line.Response.Write "Raju told ""ASP is a better scripting language"""The above line will printRaju told "ASP is a better scripting language"Mark the use of two double quotes within the string to display single double quotes.Some time we have to display some variable or strings with double quotes within a table cell. Here is a code to display session id inside a table cell. Response.Write "<tr><td>session(""userid"")</td><td>"The output of the above issession("userid")
This article is written by plus2net.com team.
Be the first to post comment on this article : |