First Bat wrote:
> hello,
>
> how do i prevent someone to enter duplicate word
>
> for example,
>
irb(main):024:0> require 'set'
=> []
irb(main):025:0> a = Set.new
=> #<Set: {}>
irb(main):026:0> a << "melon"
=> #<Set: {"melon"}>
irb(main):027:0> a << "apple"
=> #<Set: {"apple", "melon"}>
irb(main):028:0> a << "melon"
=> #<Set: {"apple", "melon"}>
Yes, no?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---