Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is \0 in a string?

I am aware of string escapements which can be used to insert special characters, for example there is the \u---- escapement, where - is a hexadecimal digit, which can be used to insert any utf-16 character. I mean can be used to insert any character with its utf-16 code. Except emoji which take up two "characters" which arent really characters because the emojis are actually just utf-32 characters. Except the emojis which are a pictograph followed by U+FE0F. Anyways, what is the function of \0 in a string?

I have tried searching on google and stackoverflow and even w3school's javascript String lesson and could not find anything.

like image 661
cmarangu Avatar asked Oct 20 '25 19:10

cmarangu


1 Answers

This is the escape sequence for the null character.

like image 165
MLS Avatar answered Oct 27 '25 07:10

MLS



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!