Created: 2008-08-11 02:58
Updated: 2015-11-06 02:55



StringRay exposes a powerful method to split a String into an Array of words, and further allows you to include Enumerable, thus exposing many of the most useful Array methods on your Strings.



Basic usage is really simple. Just take a normal String (the StringRay magic has already been included for you) and enumerate over it, just as you are used to doing with Arrays. By default, this enumerates over the "words" in the string.

"Oi! I'm a string, do something fun with me!".enumerate do |word|
  p word

"Who, what, when, where, why? The questions these are.".map do |word|
  word << word[0]

You can gain a lot more fine-grained control over how the string is treated by passing arguments to the enumerator methods, or by explicitly creating a StringRay enumerator and modifying it.

TODO: More examples and usage summaries!


The authoritative source for this project is available at You can clone your own copy with the following command:

git clone git://

If you want to make changes to the codebase, you need to fork your own GitHub repository for said changes. Send a pullrequest to elliottcable when you've got something ready for the master branch that you think should be merged.


To use StringRay, you need... nothing!


To develop and contribute to StringRay, you need...

  • gem install rake
  • gem install echoe
  • gem install rspec
  • gem install relevance-rcov
  • gem install yard


If GitHub is unavailable, or you prefer to fork one one of the following sources, they are also available:

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more