String manipulation in Ruby

Strings in Ruby are, just like in other programming languages, objects for handling text. If you ever tried to write some Ruby code, you are familiar with them and their syntax. But this post is not about syntax that is well known. While reading through some ruby books and tutorials I found some pretty interesting ways of dealing with strings.

Ruby memoization

I’ve been going through Ruby Best Practices book lately and, while it covers a lot of interesting topics, one thing caught my eye. It was sub-chapter about memoization.

Memoization is an optimization technique used to speed up your programs by avoiding to repeat function calls for already calculated inputs.