Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

AFAIK str2 = str will just share the RVALUE-Pointer.

I think to actually see shared strings behavior, you would have to do str2 = str.clone or str2 = str[0..-1].



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: