If the first argument of the tr method of String starts with ^, then it denotes all characters except those listed.
def canonical_form str
str.tr('^0-9', '')
end
If the first argument of the tr method of String starts with ^, then it denotes all characters except those listed.
def canonical_form str
str.tr('^0-9', '')
end