tags:

views:

293

answers:

4

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#)

+8  A: 

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

Joey
const char DblQuote = @'"'; string s = "hello " + DblQuote + "\" world"; That is in C#
Arlen Beiler
Guffa: You put it in a string: vara + "\"" + varb + "some string". (You could use a character literal also, but that would be pointless as it will be converted to a string before concatenation anyway.)
Arlen Beiler
+4  A: 

Try Google and you will get tons of ASCII tables.

Lukáš Lalinský
+1  A: 

here is another alternative: http://www.wolframalpha.com/input/?i=%22

+6  A: 

The ASCII code for the quotation mark is 34.

(Well, strictly speaking it's not a real quotation mark but the inches mark that we commonly use as quotation mark. A real quotation mark is a typographical character that is not available in ASCII.)

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.

Guffa
how do you enter it like this? vara + Char34 + varb + "some string";
Arlen Beiler
@Arlen: You put it in a string: vara + "\"" + varb + "some string". (You could use a character literal also, but that would be pointless as it will be converted to a string before concatenation anyway.)
Guffa
It's not even the symbol used for inches. That'd be a double prime (U+2033).
Joey