Working with Strings in Ruby

Similar Posts

  • Overview of Ruby

    Ruby is a high-level, interpreted programming language that was designed to make coding as enjoyable as possible. Created by Yukihiro Matsumoto in the mid-1990s, Ruby prioritizes readability, simplicity, and productivity. The language is dynamically typed, object-oriented, and often praised for its clean, expressive syntax, which resembles natural language. Ruby is particularly popular in web development,…

  • Your First Ruby Program

    As with most languages, we always want to start with a “Hello World” program. Remember, this is to make sure everything is working, as much as it is to learn the programming language. For simplicity’s sake, we’re going to use the online editor: https://www.jdoodle.com/execute-ruby-online or https://www.onlinegdb.com/online_ruby_compiler You will notice right away that in Ruby, we…

  • Repetition with Ruby

    The Ruby method each allows you to iterate over a list of items. This is essentially a for-each style of loop and is like JavaScript’s each method. Notice that the iterative value is placed inside of two pipe (|) characters. You don’t have to put everything on one line. In fact, you can’t if you have multiple…

  • Advanced Logic in Ruby

    In addition to the basic programming logic that Ruby has, it also has a few weirder forms of logic it can employ. Single Line Conditions Ruby allows for single line conditions where it is almost like a short hand. However, doing so may seem backward to normal logic, because the true block goes first. Consider…