Hello. I'm writing an application that needs to set the value of a string to an emdash (-) (U+2014). I looked at the documentation on the Char structure to see if I could find something that would accept the character code (e.g. 151 or hex 2014) and return the corresponding string, but I couldn't find anything useful. What am I missing? Thanks, Darryl R.
DarrylR wrote: > Hello. I'm writing an application that needs to set the value of a string to > an emdash (-) (U+2014). I looked at the documentation on the Char structure > to see if I could find something that would accept the character code (e.g. > 151 or hex 2014) and return the corresponding string, but I couldn't find > anything useful. With C# you can use \u2014 in a string literal e.g. string s = "\u2014"; Or you can use the same escape mechanism in a character literal e.g. char c = '\u2014'; You can also cast the int value (8212 is 0x2014) to a char e.g. char c = (char)8212; -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/