# Re: string#\[\]

**URL:** <https://www.ruby-forum.com/t/re-string/70075>\
**Category:** Ruby\
**Created:** [September 26, 2006, 6:33pm UTC](https://www.ruby-forum.com/t/re-string/70075 "2006-09-26T18:33:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_Davis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/a9adbd/32.png) [@Frank\_Davis](https://www.ruby-forum.com/u/Frank_Davis)\
**Post date:** [September 26, 2006, 6:33pm UTC](https://www.ruby-forum.com/t/re-string/70075/1 "2006-09-26T18:33:31Z")

</div>

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.
