Re: string#[]

I think Ruby treats Strings as an array of bytes. There are a lot of
benefits to it. Ruby is built on top of (and is extensible with) C, in
which strings really are an array of bytes. String supports the Pack and
Unpack operations, which allows you to use the String class when dealing
with all kinds of binary data, including making calls to external
libraries (.so files, .dll files, etc.). It’s a little funky, but it
seems to work well.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs