mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-09 21:49:31 +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;
|
||
|
}
|
||
|
}
|