I'm working my way through Project Euler, and ran into a slightly surprising omission: There is no String#shift
, unshift
, push
, or pop
. I had assumed a String was considered a "sequential" object like an Array, since they share the ability to be indexed and iterated through, and that this would include the ability to easily change the beginning and ends of the object.
I know there are ways to create the same effects, but is there a specific reason that String does not have these methods?