4
I have the following array
:
images = %W(
droido 7midias vigilantes sebrae_mei dpe_saed websat ferpamweb dpe_chronus dpe_plantao
promocast lolitaface dpe_intranet cha_bar clinica_sorriso droido_mascote bom_sabor
)
What I want is a way Ruby-Like to fetch a string
as "cha_bar" or only part of string
as "cha"
can use tbm
images[x].include? 'cha'
– Brumazzi DB
Good too! I liked the regular expression for being smaller, but the tip is.
– Luiz Carvalho
Humm, but include can be more interesting when working with variables...
– Luiz Carvalho
yes, but in the end you can say that the structures are the same, the difference is that when you use
{|s| s ...}
, ruby already creates aforeach
for your values– Brumazzi DB