3 ms·
It copies the pointer to the data and increments the reference count. When you modify a string it checks the count and copies it prior to modification if it's n
by mikewarot 2y ago
It copies the pointer to the data and increments the reference count. When you modify a string it checks the count and copies it prior to modification if it's not 1.