lib/awestruct/extensions/extend_string.rb
# Remove the accents from the string. Uses String::ACCENTS_MAPPING as the source map.
Remove the accents from the string. Uses String::ACCENTS_MAPPING as the source map.
Remove the accents from the string . Uses String :: ACCENTS_MAPPING as the source map .
def removeaccents    
    str = String.new(self)
    String::ACCENTS_MAPPING.each {|letter,accents|
      packed = accents.pack('U*')
      rxp = Regexp.new("[#{packed}]", nil)
      str.gsub!(rxp, letter)
    }
    str
  end
def removeaccents str = String . new ( self ) String :: ACCENTS_MAPPING . each { | letter , accents | packed = accents . pack ( 'U*' ) rxp = Regexp . new ( "[#{packed}]" , nil ) str . gsub! ( rxp , letter ) } str end
Remove the accents from the string.
Remove the accents from the string .