According to MSDN: \ooo ASCII character in octal notation
The following code is showing Octal character($) in c#:
char character36 = '\o44';
Console.Write(character36);
but it doesn't work.
According to MSDN: \ooo ASCII character in octal notation
The following code is showing Octal character($) in c#:
char character36 = '\o44';
Console.Write(character36);
but it doesn't work.
In Escape Sequences, which I suspect you were reading, the "ooo" is italicised to indicate that it should not be included verbatim. It should be replaced by the appropriate octal digits. "o44" aren't octal digits, you included a literal "o". The appropriate octal digits would be "044", or just "44".
But as pointed out by Andrew Savinykh, this is a documentation page about C, not about C#, and C# does not use the same syntax. It doesn't have octal escape sequences at all. The escape sequences for C# are documented on Strings (C# Programming Guide), and do not include any octal escape sequences unless you want to include the special exception of \0
. You can use hexadecimal escape sequences instead, either \u0024
or \x24
.