replaceArabicNumeralsFromEastToWest function
Replaces: any of ٠١٢٣٤٥٦٧٨٩
within a string with its respective 0123456789
Implementation
String replaceArabicNumeralsFromEastToWest(String string) {
if (string.contains(easternArabicNumeralsRegex)) {
final newString = string.replaceAllMapped(easternArabicNumeralsRegex, (m) {
return arabicNumeralsEastToWest[m.group(0)!]!;
});
return newString;
} else {
return string;
}
}