Groups | Blog | Home
all groups > dotnet compact framework > august 2006 >

dotnet compact framework : Copy Strings



ctacke/
8/28/2006 4:12:52 PM
Since a String is a reference type, it would not be a copy, simply a change
in references. At the end s1 and s2 point to the same place in memory. If
you want a copy, then make a copy - that's why the Copy method exists.

Since it's simply moving a reference it's thread safe.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--




[quoted text, click to view]

tony
8/28/2006 10:45:52 PM
Hi ,

if i have

string s1="s1";
string s2="s2";

when copy the strings

s1=s2;

1. is this action equals String.Copy ?
2. is this action is thread safe ?


AddThis Social Bookmark Button