In Ruby, to append a string to another string you can use the +
operator or the <<
operator. Here is an example:
main.rb148 chars7 lines
Both methods will concatenate the two strings and store the result in the string_one
variable. The puts
method will then output the result to the console.
gistlibby LogSnag