📅  最后修改于: 2022-03-11 15:00:39.299000             🧑  作者: Mango
String replaceFarsiNumber(String input) {
const english = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
const farsi = ['Û°', 'Û±', 'Û²', 'Û³', 'Û´', 'Ûµ', 'Û¶', 'Û·', 'Û¸', 'Û¹'];
for (int i = 0; i < english.length; i++) {
input = input.replaceAll(english[i], farsi[i]);
}
return input;
}
main() {
print(replaceFarsiNumber('0-1-2-3-4-5-6-7-8-9')); // ==> Û°-Û±-Û²-Û³-Û´-Ûµ-Û¶-Û·-Û¸-Û¹
}