Ruby Infinity: How It Works & Why It Matters

What is infinity in Ruby? It’s something that has a starting point but no ending. In Ruby, we can express this concept of infinity with the Float::INFINITY constant. You may be wondering how this is useful. Let me explain with examples! Infinity As A Result Of Arithmetic Operations Ruby returns an Infinity object, as the … Read more

3 Awesome Ways To Use Ruby’s Gsub Method

Let’s talk about Ruby’s gsub method & how to use it. First, you’ll need a string to play with this method. Why? Because the whole point of gsub is to replace parts of a string. In fact: The “sub” in “gsub” stands for “substitute”, and the “g” stands for “global”. Here is an example string: … Read more