Method: Array#join
- Defined in:
- lib/source/ruby.rb
#join(str = '') ⇒ Object
call-seq:
ary.join(str = '') -> string
Returns a string version of ary created by calling to_s on each element (or join(str) if the element is also an array), then concatenating the resulting strings with str between them.
%w(a b c).join #=> "abc"
%w(a b c).join('.') #=> "a.b.c"
2374 2375 2376 2377 2378 |
# File 'lib/source/ruby.rb', line 2374 def join(str = '') `var result=this[0]!=null?this[0].m$join?this[0].m$join(str.__value__).__value__:this[0].m$to_s().__value__:''` `for(var i=1,l=this.length;i<l;++i){result+=(str.__value__||'')+(this[i].m$join?this[i].m$join(str).__value__:this[i].m$to_s().__value__);}` return `$q(result)` end |