Match values from Drop Down

Hi All,
i have a Scenario, wherein I am getting list of Drop Down values
from a select box. I need to validate whether particualr string or value
exists in the drop down.

collect = get_select_options(“dropdownElement”)
puts collect
Output of collect would be like this with all drop down values
{Nov 19 '11,Dec 17 '11,Oct 28 '11w,Jan 21 '12,Feb 18 '12,Mar 17 '12,Dec
22 '12,Dec 21 '13}

Now I want to check for value date with ‘w’ in that, in the above case
its “Oct 28 '11w”

collect.each do |line|
if line == “Oct 28 '11w” – (i don’t want to hard code date like
do code
pattern doesn’t exists.

How do i solve this issue, Can i directly match value with regular
please let me know if i am clear with my explanation.


Can i directly match value with regular

definitely… check out these links and see if they help:

  • j

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs