O'Reilly logo

Ruby Phrasebook by Jason Clinton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Working with Strings

Gluing applications together is what programming languages like Ruby and Perl do particularly well: their text processing facilities are excellent. Whether its parsing configuration files, serving up web pages or capturing the output of a program, you will be working with Strings. Where Ruby and Perl differ, however, is in the object oriented-ness of their approach. In Ruby, Strings have their own member methods which can be accessed to perform each processing function. Keep this in mind throughout this section.

The following subsection and the next two subsections are closely related. I first briefly present the simple searching functions that accept Strings as parameters; then I dive right in to regular expressions. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required