Arlen Beiler
Arlen Beiler

Reputation: 15866

Double Quotes in ASCII

What is the ASCII number for the double quote? (")

Also, is there a link to a list anywhere?

Finally, how do you enter it in the C family (esp. C#)

Upvotes: 3

Views: 100525

Answers (4)

Guffa
Guffa

Reputation: 700232

The ASCII code for the quotation mark is 34.

There are plenty of ASCII tables on the web. Note that some describe the standard 7-bit ASCII code, while others describe various 8-bit extensions that are super-sets of ASCII.

To put quotation marks in a string, you escape it using a backslash:

string msg = "Let's just call it a \"duck\" and be done with it.";

To put a quotation mark in a character literal, you don't need to escape it:

char quotationMark = '"';

Note: Strings and characters in C# are not ASCII, they are Unicode. As Unicode is a superset of ASCII the codes are still usable though. You would need a Unicode character table to look up some characters, but an ASCII table works fine for the most common characters.

Upvotes: 17

Marianne Seggerman
Marianne Seggerman

Reputation: 123

you are never going to need only 1 quote, right? so I declare a CHAR variable i.e

char DoubleQuote; 

then drop in a double quote

Convert.ToChar(34);

so use the variable DoubleQuote where you need it

works in SQL to generate dynamic SQL but there you need

DECLARE @SingleQuote CHAR(1)
and
SET @SingleQuote=CHAR(39)

Upvotes: 1

user5634304
user5634304

Reputation: 11

yes, the answer the 34

In order to find the ascii value for special character and other alpha character I'm writing here small vbscript. In a note pad, write the below script save as abc.vbs(any name with extention .vbs) double click on the file to execute and you can see double quotes for 34.

For i=0 to 150

msgbox i&"="&char(i)

next

Upvotes: 1

Joey
Joey

Reputation: 354416

It's 34. And you can find a list on Wikipedia.

Upvotes: 9

Related Questions