 <p>The behaviour of this operator is different across various versions of Ruby. You're probably using an older one, in which case this is to be expected. </p> <p>Here's an excerpt from the <a href="http://ruby-doc.org/core-1.8.7/String.html#method-i-5B-5D" rel="nofollow">docs for Ruby 1.8.7's String class</a></p> <blockquote> <p>If passed a single Fixnum, returns the code of the character at that position.</p> </blockquote> <p>This has been changed and the newer versions of Ruby (1.9.x and above, according to <a href="http://ruby.about.com/od/strings/a/Indexing-Strings.htm" rel="nofollow">this site</a> ) simply print the character as a String. See <a href="http://ruby-doc.org/core-2.1.0/String.html#method-i-5B-5D" rel="nofollow">the docs for Ruby 2.1.0</a>.</p> <blockquote> <p>If passed a single index, returns a substring of one character at that index.</p> </blockquote> <p>Ruby 1.9.3, which I happen to have installed on the machine I'm using displays exactly the same behavior:</p> <pre><code>"Mwada"[0] =&gt; "M" "Mwada"[0].class =&gt; String </code></pre>