convertToArabicNumbers function

String convertToArabicNumbers(
  1. String str
)

arabic numbers are 0123456789 convert numbers to arabic format 0123456789 becomes ٠١٢٣٤٥٦٧٨٩

Implementation

String convertToArabicNumbers(String str) {
  return str
      .replaceAll('٠', '0')
      .replaceAll('١', '1')
      .replaceAll('٢', '2')
      .replaceAll('٣', '3')
      .replaceAll('٤', '4')
      .replaceAll('٥', '5')
      .replaceAll('٦', '6')
      .replaceAll('٧', '7')
      .replaceAll('٨', '8')
      .replaceAll('٩', '9');
}