Try this:
a.gsub!(/(\W|\d)/, "")
=> "ABC"
b.gsub!(/(\W|\d)/, "")
=> "JE"
1
solved regex for collect letter inside string ruby [closed]
Try this:
a.gsub!(/(\W|\d)/, "")
=> "ABC"
b.gsub!(/(\W|\d)/, "")
=> "JE"
1
solved regex for collect letter inside string ruby [closed]