Method: String#concat
- Defined in:
- lib/source/ruby.rb
#concat(obj) ⇒ Object
call-seq:
str << num -> str
str << obj -> str
str.concat(num) -> str
str.concat(obj) -> str
Append – concatenates the given object to str. If the object is an integer between 0 and 255, it is converted to a character before concatenation.
a = 'abc'
a.concat('def') #=> "abcdef"
a.concat(103).concat(104) #=> "abcdefgh"
5530 5531 5532 5533 |
# File 'lib/source/ruby.rb', line 5530 def concat(obj) `this.__value__+=(typeof(obj)=='number'?String.fromCharCode(obj):obj.__value__)` return self end |