SQL PHP HTML ASP JavaScript articles and free scripts to download
 

Printing double quotes in ASP


In 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 print

Raju 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 is
session("userid")


Sections
PHP
JavaScript
ASP
HTML
SQL
Photoshop
Articles SEO
All ASP Tutorials
Introduction
ASP Sections
Ajax
Date and time
Declaring array
Form in ASP
Server.MapPath
Date Time & MSSQL
Select Query
File System Object
String Functions
Popular Tutorials
Managing two drop downs
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.