What is the phrase phrase VB "Chr (0)", equivalent in C #?

What is the expression of the operator VB Chr(0) equivalent in C #?

Thanks for any help.

+8
c # vb6 vb6-migration
source share
4 answers

I believe the equivalent of '\0'

I deleted the comment because, as I thought, it is more advisable to update it in the message :)

 sValue = vValue + Chr(0) 'As mentioned in your comment 

can be written as

 sValue += "\0"; 
+14
source share

You can use (char)0 . Or '\0' , of course. If you want to call a method, you can use Convert.ToChar(0) .

+7
source share

The equivalent would be (char) 0. If you are looking for escape sequences and other characters, you can use \ n and similarly

+2
source share
 sValue == vValue + Strings.Chr(0) 

You can try it yourself using this website.

-one
source share

All Articles