Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String class vs String type
Message
 
To
20/05/2002 10:49:18
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
Migration
Miscellaneous
Thread ID:
00658891
Message ID:
00658911
Views:
11
Hi Rex

They both are the same. The System.String is a DataType class that exposes static methods. Unlike other classes, C# and VB .NET do *NOT* allow you to instantiate some DataTypes using:
// C#
System.String lcString = new System.String();
string lcString = new string(); //"string" is a short name for System.String in C#

'VB .NET
Dim lcString As System.String = New System.String()
Dim lcString As String = New String()
Simply assigning a value to the declared type creates an instance the class.
// C#
System.String lcString = "MyString";
string lcString = "MyString";

'VB .NET
Dim lcString As System.String = "MyString"
Dim lcString As String = "MyString"
Kamal

>Ok guys, here is a elementary, basic , I should know this question:
>
>What is the difference between a string class and a string type?
>
>I know the class has properties and methods, but when do you use a class and when do you use the string type?
>
>TIA
>
>Rex
Previous
Reply
Map
View

Click here to load this message in the networking platform