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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.