curateMunicipality function

String curateMunicipality (
  1. String municipality
)

Method that eliminates the letters with tilde, dieresis, etc.

Implementation

String curateMunicipality(String municipality) {
  return municipality
      .toLowerCase()
      .replaceAll('á', 'a')
      .replaceAll('é', 'e')
      .replaceAll('í', 'i')
      .replaceAll('ó', 'o')
      .replaceAll('ú', 'u')
      .replaceAll('ü', 'u')
      .replaceAll('ñ', 'n')
      .replaceAll('-', '');
}