Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/sixarm_ruby_unaccent/string.rb

Overview

String extensions.

Instance Method Summary collapse

Instance Method Details

#unaccentString

Replace a string's accented characters with unaccented characters.

Examples:

s = "Å Ç ß"
s.unaccent = > "AA C ss"

Returns:

  • (String)

    a string that has no accents



16
17
18
# File 'lib/sixarm_ruby_unaccent/string.rb', line 16

def unaccent
  split(//u).map {|c| ACCENTMAP[c] || c }.join("")
end