ruby remove non ascii characters code example
Example 1: remove ascii characters from string ruby
s.delete!("^\u{0000}-\u{007F}")
Example 2: remove ascii characters from string ruby
s.gsub!(/\P{ASCII}/, '')
s.delete!("^\u{0000}-\u{007F}")
s.gsub!(/\P{ASCII}/, '')