How strings are stored and what copying them costs
What is a string under the hood? Describe the fields a string struct holds and how you would implement one yourself, then give the time cost of copying a string and of common operations on it. Expect follow-ups on how languages avoid needless copies.
No answer yet. Write the first one; the best answer gets endorsed.
