'\0' will be just fine in C #.
What happens is that C # sees \0 and converts it to nul-character with an ASCII value of 0; then he sees two more 0 s, which is illegal inside the character (since you used single quotes, not double quotes). Nul-character is usually not printed, so it looked like an empty line when you tried to print it.
What you typed in Java is a character literal supporting octal . C # does not support octal literals in characters or numbers to reduce programming errors. *
C # supports Unicode literals of the form '\u0000' , where 0000 is a four-digit hexadecimal number.
* In PHP, for example, if you enter a number with a zero number, which is a real octal number, it will be translated. If this is not a legal octal number, it will not be translated correctly. <? echo 017; echo ", "; echo 018; ?> <? echo 017; echo ", "; echo 018; ?> prints 15, 1 to my car.
source share