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, ...

Get Ruby by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.