banToEng static method
bangla to english banToEng converter method
Implementation
static String banToEng(inputValue) {
//convert to string and make a list
var strList = inputValue.toString().split('');
//declare a list variable
List<String> returnList = [];
//loop on the list
for (var str in strList) {
//switch case to convert number and add to the list
switch (str) {
case "০":
returnList.add("0");
break;
case "১":
returnList.add("1");
break;
case "২":
returnList.add("2");
break;
case "৩":
returnList.add("3");
break;
case "৪":
returnList.add("4");
break;
case "৫":
returnList.add("5");
break;
case "৬":
returnList.add("6");
break;
case "৭":
returnList.add("7");
break;
case "৮":
returnList.add("8");
break;
case "৯":
returnList.add("9");
break;
default:
returnList.add(str);
break;
}
}
//return all join list
return returnList.join("");
}