differene between clone and copy in .net

Posted by Shanky11 under C# on 4/5/2013 | Points: 10 | Views : 649 | Status : [Member] | Replies : 4
what's the defference b/w String.copy() and String.Clone()
what are the simialriteis and dissimilarities of both this


if anyone know the actua difference then tell me
where to use clone and copy????




Responses

Posted by: Satyapriyanayak on: 4/5/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
string.clone- Returns a reference to this instance of String.
string.copy-Creates a new instance of String with the same value as a specified String.

http://msdn.microsoft.com/en-us/library/system.string.clone.aspx
http://msdn.microsoft.com/en-us/library/system.string.copy.aspx

If this post helps you mark it as answer
Thanks

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rohit1 on: 4/5/2013 [Member] Starter | Points: 25

Up
0
Down
Clone will copy the structure of a data where as Copy will copy the complete structure as well as data

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raja_89 on: 4/6/2013 [Member] Starter | Points: 25

Up
0
Down
Hai
Clone[Shallow Copy] : Copies the complete schema only
Copy[Deep Copy] :Copies data structure and data

Regards


Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Chandan88 on: 4/6/2013 [Member] Starter | Points: 25

Up
0
Down
clone is used to copy the structure whereas copy is used to copy structure as well as the data.



Chandan Singh

Shanky11, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response