Personally, I would use the escape sequence "\ u":
const char Delete = '\u007f';
I'm not interested in the escape sequence "\ x" mentioned elsewhere - it's not so bad in character literals (where a few characters => a compiler error), but it can be annoying for string literals:
// Tab the output Console.WriteLine("\x9Good line"); Console.WriteLine("\x9Bad line");
Assuming you can see the error here, how confident are you that you avoid it when creating a βjust quick changeβ?
Given that I am avoiding this for string literals, I think it makes sense to be consistent and just use "\ u" everywhere that I want to escape the hex value.
source share