As some may recall, I'm fiddling with some string manipulation in a recent
series of articles. I'm wondering about the specific implementation of
operations like slice, on String (and on Array). 

Specifically, does slicing a String copy the bytes, or point into the old
string, and similarly for Array? I see that if I modify the slice, the original
is not modified, and vice versa, but have the bytes already been copied when the
slice is created? Or not until later?

Similar questions for Array, all around, and for operations like <<.

Bottom line, are all the methods of String and Array directly allocating
storage, or are any of them "virtual"?

My guess is that the bytes are copied. If so, is anyone aware of a class or
classes that address substrings and such as virtual copies?

Thanks,

-- 
Ron Jeffries
www.XProgramming.com
I'm giving the best advice I have. You get to decide if it's true for you.