// https://snip.uncox.com/study/169
// 0123456789 : ۰۱۲۳۴۵۶۷۸۹
public static String numE2P(String str) {
return numE2P(str, false);
}
public static String numE2P(String str, boolean reverce) {
String[][] chars = new String[][]{
{"0", "۰"},
{"1", "۱"},
{"2", "۲"},
{"3", "۳"},
{"4", "۴"},
{"5", "۵"},
{"6", "۶"},
{"7", "۷"},
{"8", "۸"},
{"9", "۹"}
};
for (String[] num : chars) {
if (reverce) {
str = str.replace(num[1], num[0]);
} else {
str = str.replace(num[0], num[1]);
}
}
Log.v("numE2P", str);
return str;
}
// https://snip.uncox.com/study/169
MyUtils.numE2P("1396/9/12");
// LOG : ۱۳۹۶/۹/۱۲
// 0123456789 : ۰۱۲۳۴۵۶۷۸۹