Wiki Home

VBDotNet Strings


Namespace: DotNet

Culled from the public newsgroups on news.devx.com. I'd like to credit the author, but I'm not sure he'd like that. -- Nancy Folsom
System.String objects are themselves immutable (VB uses System.String as its intrinsic string type, as does C#.) When you declare "Dim MyStr as String" you are declaring a variable that is a reference to a string, the reference can be reassigned to reference other string objects, but any string object it references cannot be modified (the object provides no mechanism for modification, but there are manipulation functions that return new string objects.)

Long story short, strings are no longer a value type, they are now an object type, as you can only have references to object types and string objects are immutable, a string reference cannot have a length constraint on it.

Also, these changes are supposed to make VB.Net string handling code far speedier then in previous VB4/5/6 days.
Category DotNet Category VBDotNet
( Topic last updated: 2000.10.10 11:01:34 PM )