O'Reilly logo

Ruby by Example by Kevin C. Baird

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 4. Text Manipulation

image with no caption

Text is the basic format for storing configuration data, web content, email, as well as data written in XML (eXtensible Markup Language) and YAML (YAML Ain’t Markup Language) which we’ll be looking at in greater detail later. It’s important for a programming language to deal with text easily and efficiently. Luckily, Ruby meets this requirement. This chapter includes several scripts that demonstrate Ruby’s approach to some common text-oriented problems.

#9 End-of-Line Conversion (dos2unix.rb)

If you’ve never had to deal with end-of-line (EOL) differences among operating systems, consider yourself fortunate. Microsoft, ...

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