Forum: Ruby Re: Hash default -- what's going on here?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
87e9a89c53ccf984db792113471c2171?d=identicon&s=25 Kroeger, Simon (ext) (Guest)
on 2006-03-15 10:37
(Received via mailing list)
> [...]
> Sigh.  Hardly a novel gotcha, but I fell right into it.
>
> Not sure of the best way to do what I want -- maybe just use
> 'has_key?'
> and then do the right thing.
> 					-- Pete --


maybe

listA=["line1","line2","line3"]
listB=["line5","line3","line4"]

puts(listA & listB)

#=> line3

?

cheers

Simon
This topic is locked and can not be replied to.