Ad
  • Custom User Avatar

    That's because (in Ruby and many other languages) you can use an integer to get to the n-th charactetr in a String just as you can get the n-th element of an Array.
    You can think of a String as an ordered list of charscters (technically code points, but thats another story).