mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-05 02:39:26 +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;
|
||
|
}
|
||
|
}
|