PaulB
PaulB

Reputation: 24422

String cannot contain embedded nulls?

Just looking at the docs for ModuleBuilder and it's method DefineType which takes a string amongst other parameters.

In the write up it states the parameter 'cannot contain embedded nulls'.

What does that mean?

Upvotes: 3

Views: 1542

Answers (2)

IAmTimCorey
IAmTimCorey

Reputation: 16755

A string is not null terminated (ends on a null) so therefore you can actually store null characters ('\0') inside of a string. The string you are going to work with cannot have one of these special characters inside it.

Here is Microsoft's definition of string in reference to null characters:

http://msdn.microsoft.com/en-us/library/ms228362.aspx

Upvotes: 1

dtb
dtb

Reputation: 217401

An example of a string with an embedded null is:

var example = "This is a null: \0";

'\0' is the Unicode character 'NULL' (U+0000).

Upvotes: 6

Related Questions