Possible Duplicate:
In C# what is the difference between String and string
Should I use string
or String
when declaring a basic string variable in c# and does it matter?
string is an alias in the C# language for System. String . Both of them are compiled to System. String in IL (Intermediate Language), so there is no difference.
Copy(String) Method is used to create a new instance of String with the same value as a specified String. In other words, this method is used to copy the data of one string into a new string. The new string contains same data like an original string but represents a different object reference.
The difference is that String is a type and string is not.
In C#, Clone() is a String method. It is used to clone the string object, which returns another copy of that data. In other words, it returns a reference to this instance of String. The return value will be only another view of the same data. Clone method called directly on current String instance.
I like string
because VS highlights it in dark blue (which makes it awesomer).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With