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
constant value interpolation : Convert to String « Number « Ruby
Ruby
Number
Convert to String
constant value interpolation
number = 5 puts
"The number is #{5}."
# =>
"The number is 5."
Related examples in the same category
1.
Integer passed into a string with interpolation
2.
Substituting Variables Into Strings
3.
String interpolation with method call
4.
String interpolation with calculation
5.
Convert float to string
6.
Convert integer to string by parameter
7.
Convert string to integer with error