Using the + symbol concatenates the two strings "Test" and "String" to produce "TestString".
puts "Success!" if "Test" + "String" == "TestString"
You can multiply strings.
For example, let's say you want to replicate a string five times, like so:
puts "abc" * 5
You can also perform "greater than" and "less than" comparisons:
puts "x" > "y" puts "y" > "x"
"x" > "y" and "y" > "x" are expressions that result in true or false outcomes.
In this situation, Ruby compares the numbers that represent the characters in the string.
To learn what value a particular character has, find out like so:
puts ?x puts ?A
A question mark followed by a character returns an integer matching the position of that character in the ASCII table.
You can achieve the inverse by using the String class's chr method. For example:
puts ?x puts 120.chr