Convert Arabic String to english number in Swift
<p>How to convert non English number to English number like :
"٣٤٨٦٩١٢٨٨١" to "3486912881" in Swift
or I want to accept just english numbers and obtain others.</p>

<p>In Java Android this code is working for me:</p>

<pre><code>private static String arabicToDecimal(String number) {
    char[] chars = new char[number.length()];
    for(int i=0;i&lt;number.length();i++) {
        char ch = number.charAt(i);
        if (ch &gt;= 0x0660 &amp;&amp; ch &lt;= 0x0669)
           ch -= 0x0660 - '0';
        else if (ch &gt;= 0x06f0 &amp;&amp; ch &lt;= 0x06F9)
           ch -= 0x06f0 - '0';
        chars[i] = ch;
    }
    return new String(chars);
}
</code></pre>