System.String vs string

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

What is the difference between these two types. The both seem to have the
same methods. Is there an advantage to one over the other?
 
C# aliases types in the .NET Framework Base Class Library. C# string type
is really an alias for the System.String class in the .Net framework
library.
 
string maps to System.String. There is no disadvantage to use string in place
of String anywhere in your code. The only complaints you'll hear are completely
stylistic. Even the BCL team had an ongoing thought bubble about using C#
versus
BCL types in the source for the BCL itself.
 
They are the same. string maps to System.String.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top