# iterating over split characters words = "one two three" words.each do |word| puts word # prints one, two, and three on separate lines end # appending to a string words << " four" puts words # prints "one two three four" # multiplying puts "Ho! " * 3 # prints "Ho! Ho! Ho!" # splitting strings puts words[0..3] # prints "one" puts words[/t.*\s/] # pritns "two three" # iterate over the bytes in a string "hi".each_byte do |byte| puts byte end # reversing a string puts "foobar".reverse # converting strings puts "deadbeef".hex # convert hex to a number puts "456".oct # convert oct to a number puts "123".to_i # convert string to a number # multi-line strings multiline = <