On 9 February 2011 12:29, Erwin <yves_duf...@mac.com> wrote:
> with a string like :  subpart.content_type = "video/mp4; name=tom1-
> short.mp4"
> is there anyway to avoid a loop in checking if this string contains
> one of the extension in an array ['mp4', 'm4v', 'mov']
>
> something like :
>
> subpart.content_type.include_one_of_them? ['mp4', 'm4v', 'mov']

You can use a regular expression.  Google ruby regular expressions if
you do not know how.

Colin

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to