Posted By

tonic on 06/20/08


Tagged

rails ruby acentos ees


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

webstic
simonmd


Función básica para eliminiar acentos en minúsculas


 / Published in: Ruby
 

  1. def quita_acentos( texto)
  2. texto= texto.gsub('á', 'a')
  3. texto= texto.gsub('é', 'e')
  4. texto= texto.gsub('í', 'i')
  5. texto= texto.gsub('ó', 'o')
  6. texto= texto.gsub('ú', 'u')
  7. end

Report this snippet  

You need to login to post a comment.