Vs String in .NET.
I was using developerfusion.com to convert a snippet of my C # code to VB.NET and I noticed that the String type was translated to [String].
I tried googling and searching SO to no avail, so I'll ask the community if there is a difference between [String] and String? And if so, what is the difference between them (?)?
+1
a source to share
4 answers
The converter may have done this because it didn't recognize the string type and thought it was a class defined in your code.
You can place parentheses around identifiers for keyword usage. You can create your own class [String]
that is different from the built-in class String
, but this can of course be easily confusing ...
Public Class [String]
Public Value As Integer
End Class
Dim s As New [String]
s.Value = 42
+6
a source to share