Whats the ASCII number for "?

StageLeft

No Lifer
Sep 29, 2000
70,150
5
0
I am trying to include a " in my string but it keeps thinking its an end string so I need the proper number or whatever it is called. For instance 100 is 'd', so what number corresponds with a double quote? :)
 

StageLeft

No Lifer
Sep 29, 2000
70,150
5
0
Thanks guys - for some reason VB thinks asc(34) = 51
but thankfully I'm able to use single quotes so I got past this problem for now :p Dunno why #34 isn't a double though...
 

RossMAN

Grand Nagus
Feb 24, 2000
78,940
395
136
I swear you can get the answer to just about any question in these forums, I love this place and the combined knowledge of 50,000 plus geeks.
 

ThisIsMatt

Banned
Aug 4, 2000
11,820
1
0
Skoob...try 034 like Yo_Ma-Ma said...I don't know how VB works, but in java you'd just use \" as an escape sequence, or (char)(34)...using 034 in java gives small rotated "L" type character though, like the one I'm using as a gun in my sig, except for upside down :confused:
 

Mapidus

Senior member
Jun 9, 2001
457
0
0


<< Skoob...try 034 like Yo_Ma-Ma said...I don't know how VB works, but in java you'd just use \&quot; as an escape sequence, or (char)(34)...using 034 in java gives small rotated &quot;L&quot; type character though, like the one I'm using as a gun in my sig, except for upside down :confused: >>



I can't recall for sure, but I think the /xxx escape sequences in Java and C are interpreted as hex escape values instead of decimal. This could be why you are getting odd characters.
 

ThisIsMatt

Banned
Aug 4, 2000
11,820
1
0


<<

<< Skoob...try 034 like Yo_Ma-Ma said...I don't know how VB works, but in java you'd just use \&quot; as an escape sequence, or (char)(34)...using 034 in java gives small rotated &quot;L&quot; type character though, like the one I'm using as a gun in my sig, except for upside down :confused: >>



I can't recall for sure, but I think the /xxx escape sequences in Java and C are interpreted as hex escape values instead of decimal. This could be why you are getting odd characters.
>>

You don't put numbers in an escape sequence...they're just for showing characters otherwise reserved in Java when working with strings (ie. \&quot;, \', \\, \n, \b, \r, \t). I got the odd character when I cast 034 to a character, (char)(034), but I got the correct character when doing (char)(34).
 

OZEE

Senior member
Feb 23, 2001
985
0
0
Dunno what program ur using, but I've seen apps that to include a &quot; in a print-string you had to use double double-quotes (i.e., &quot;&quot;)
 

Mapidus

Senior member
Jun 9, 2001
457
0
0


<<

<<

<< Skoob...try 034 like Yo_Ma-Ma said...I don't know how VB works, but in java you'd just use \&quot; as an escape sequence, or (char)(34)...using 034 in java gives small rotated &quot;L&quot; type character though, like the one I'm using as a gun in my sig, except for upside down :confused: >>



I can't recall for sure, but I think the /xxx escape sequences in Java and C are interpreted as hex escape values instead of decimal. This could be why you are getting odd characters.
>>

You don't put numbers in an escape sequence...they're just for showing characters otherwise reserved in Java when working with strings (ie. \&quot;, \', \\, \n, \b, \r, \t). I got the odd character when I cast 034 to a character, (char)(034), but I got the correct character when doing (char)(34).
>>



It is not normally used, but escape sequences like \065 are valid in C and Java. Try some thing like &quot;\065&quot; and you should get a character. Java calls these Unicode escape sequences. So println(&quot;\065&quot;) should give you A as the outputI believe. Sorry can't test this as I do not have a development environment now.
 

ThisIsMatt

Banned
Aug 4, 2000
11,820
1
0
Mapidus - ahhh, I see. BUT, that still doesn't work &quot;correctly&quot;. Using either 065 or 65 gives me &quot;5&quot;, instead of &quot;A&quot;. I'm using Java(R) 2 SDK Standard Edition Version 1.2.1...
 

Mapidus

Senior member
Jun 9, 2001
457
0
0
maybe try \041 or \101 for A. I think that Java expects the Hex ASCII numbering (maybe the Oct numbering, not sure) instead of the decimal ones. The following chart gives you the Dec, Hex, and Oct ASCII values. If you want the characters that are in unicode but not in ASCII I think you can use \uXXXX, where the XXXX is the hexadecimal unicode value for that character so \u0041 should give A I think. Sorry, still can't test any of this because I do not have the JDK installed.