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