I have:

array = ["this ends in log", "this ends in dog", "this is a log"]

I want to discard strings that end in the same word. How far off is my attempt?

array.reject { |i| i[0] =~ /\s\w$/ == i[1] =~ /\s\w$/ }

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/lPOGHXmhnwIJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 8, '12 at 5:57p
activeMar 9, '12 at 3:32p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Simpleton: 1 post Nicolas Sebrecht: 1 post

People

Translate

site design / logo © 2022 Grokbase