String.*
Signature
string * positive_integer #=> new_string
string.* returns a new string that is composed of
positive_integer copies of string.
Examples
"x" * 5 #=> "xxxxx"
"x".*(5) #=> "xxxxx"
"x" * 0 #=> ""
# * will not accept a negative integer
y = 'foo'
begin
y * -2
rescue Exception => e
e.inspect #=> #
end
Documentation Reference
- Log in to post comments
