top | item 8993237 (no title) DoggettCK | 11 years ago That was my assumption, too. They do memoize the length, but I'm sure those bytes add up, having run into OutOfMemoryExceptions building huge amounts of strings before. discuss order hn newest reddiric|11 years ago Strings know their length in the CLR because they are represented as BSTRshttp://blogs.msdn.com/b/ericlippert/archive/2011/07/19/strin...This lets them interoperate with OLE Automation. porges|11 years ago You have to store the length, C# strings can contain '\0' (although the hashing code doesn't take this into account!)
reddiric|11 years ago Strings know their length in the CLR because they are represented as BSTRshttp://blogs.msdn.com/b/ericlippert/archive/2011/07/19/strin...This lets them interoperate with OLE Automation.
porges|11 years ago You have to store the length, C# strings can contain '\0' (although the hashing code doesn't take this into account!)
reddiric|11 years ago
http://blogs.msdn.com/b/ericlippert/archive/2011/07/19/strin...
This lets them interoperate with OLE Automation.
porges|11 years ago