Reputation: 2289
I have nubmers of simple strings 'som', 'man', 'pal'
, etc
How do i make vowel character upcase!
, having vowel regex or array to have output like 'sOm', 'pAl', 'mAn' ?
Upvotes: 2
Views: 3636
Reputation: 168101
"som".gsub(/[aeiou]/, &:upcase)
# => "sOm"
or
"som".tr("aeiou", "AEIOU")
# => "sOm"
Upvotes: 8