Does anyone know of a quick and elegant way to convert ASCII strings in the form of "\<some character>" to the corresponding byte value. For example, if I have the string "\n" I would like to convert it to the byte value of 0x0A. I realize I could brute force it with a case structure or a lookup table but I need to do this for all of the various escape character sequences. So far I haven't come up with a simple solution.
↧