Difference between String and string?
-
Hi Groups What is the Difference between String and string? When will we use String? Bye
-
-
Hi Groups What is the Difference between String and string? When will we use String? Bye
String
is class.string
is a keyword (which is under the hood is translated to .NET classSystem.String
)Sincerely, Elina Life is great!!! Enjoy every moment of it! :-O
-
All classes are types.
string
is a synonym forSystem.String
nothing more, nothing less.
Upcoming events: * Glasgow: SQL Server 2005 - XML and XML Query Plans, Mock Objects, SQL Server Reporting Services... Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website
-
Hi Groups What is the Difference between String and string? When will we use String? Bye
No difference! string is a keyword,but String not. string just like a shortcut for String.
:^):^):^):^):^):^):^):^):^):^):^):^) :^):rose::rose::rose::rose::rose:▒▒〓▒〓▒▒ :^):rose::^):^):^):^)▒〓〓〓〓〓▒ :^):rose::^):^):^):^)▒▒〓▒〓▒▒ :^):rose::^):^):^):^)▒〓〓〓〓〓▒ :^):rose::rose::rose::rose::rose:▒▒〓▒〓▒▒ :^):^):^):^):^):^):^):^):^):^):^):^)
-
Hi Groups What is the Difference between String and string? When will we use String? Bye
The keyword
string
is an alias forSystem.String
. I only know of two differences between using an alias keyword and the specific class name: :: You have to haveusing System;
to useString
, otherwise you have to specify the full nameSystem.String
. :: For some special uses of data types only the keyword works. You can for example specify that an enum should useint
as internal storage type, but you can't specifySystem.Int32
instead.--- single minded; short sighted; long gone;
-
blumenhause wrote:
"String" is a Class in C#
Well, you are right in that
System.String
is class. But how you say it is... um...System.String
is CLI built-in type/class.string
is C# specific alias ofSystem.String
I didn't vote but someone probably found your answer confusing. :)
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
-
The keyword
string
is an alias forSystem.String
. I only know of two differences between using an alias keyword and the specific class name: :: You have to haveusing System;
to useString
, otherwise you have to specify the full nameSystem.String
. :: For some special uses of data types only the keyword works. You can for example specify that an enum should useint
as internal storage type, but you can't specifySystem.Int32
instead.--- single minded; short sighted; long gone;
-
blumenhause wrote:
"String" is a Class in C#
Well, you are right in that
System.String
is class. But how you say it is... um...System.String
is CLI built-in type/class.string
is C# specific alias ofSystem.String
I didn't vote but someone probably found your answer confusing. :)
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe