mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-24 13:09:24 +01:00
16 lines
482 B
Dart
16 lines
482 B
Dart
extension StringCasingExtension on String {
|
|
String removeDiacritics() {
|
|
const withDia =
|
|
'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
|
|
const withoutDia =
|
|
'AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz';
|
|
|
|
String str = this;
|
|
for (int i = 0; i < withDia.length; i++) {
|
|
str = str.replaceAll(withDia[i], withoutDia[i]);
|
|
}
|
|
|
|
return str;
|
|
}
|
|
}
|