Neat collection of Ruby one-liners

Neat collection of Ruby one-liners
Average rating: 0
(0 votes)

Meet this huge collection of Ruby one-liners! Mostly file oriented stuff, like adding blank lines into files, adding line numbers into text files, counting lines, selective printing of certain lines… But very useful. As a bonus, you’ll find the links to the other lists with different Ruby one-liners!

To start from, the concept of a one-liner program has been known since the 1960s with the release of the APL programming language. With its terse syntax and powerful mathematical operators, APL allowed useful programs to be represented in a few symbols.

Benoit Hamelin created this list himself, and it is worth sharing! He made a list of

Ruby one-liners

for:

  1. File spacing
  2. Numbering and calculations
  3. String creation
  4. Array creation
  5. Text conversion and substitution
  6. Selective printing of certain lines
  7. Selective deletion of certain lines

Find them all in the original Benoit’s blog post!

 

More Ruby one-liners:

  1. Smooth Ruby One-Liners list by Ryan Palo
  2. A very huge collection of Ruby one-liners by Sundeep Agarwal

Also, read our article about 5 Ruby methods for solving specific types of problems.

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

*By submitting this form you agree with our Privacy Policy.

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111