mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 23:12:37 +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;
|
||
|
}
|
||
|
}
|