Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Push several strings into one : String Concatenation « String « Ruby
Ruby
String
String Concatenation
Push several strings into one
"Hello,"
<<
" "
<<
"myValue"
<<
"!"
# => Hello, myValue!
Related examples in the same category
1.
Append one string to another with the + method:
2.
append a string with the << method:
3.
Concatenate (join) strings together, using a +
4.
Using the + symbol concatenates the two strings "
5.
inserting value of a variable in a string
6.
Encode command in string