Notifications
Announcements
No record found.
Hi All,
if anyone has code to convert number(8893) to arabic number(٨٨٩٣) like in x++ ax 2012, Please provide me or please tell me how to do that.
Thanks in advance
akshay
*This post is locked for comments
Hi Akshay,
please find the following method
public string ConvertToEasternArabicNumerals(string input) { System.Text.UTF8Encoding utf8Encoder = new System.Text.UTF8Encoding(); System.Text.Decoder utf8Decoder = utf8Encoder.GetDecoder(); System.Text.StringBuilder convertedChars = new System.Text.StringBuilder(); char[] convertedChar = new char[1]; byte[] bytes = new byte[] { 217, 160 }; char[] inputCharArray = input.ToCharArray(); foreach (char c in inputCharArray) { if (char.IsDigit(c)) { bytes[1] = Convert.ToByte(160 + char.GetNumericValue(c)); utf8Decoder.GetChars(bytes, 0, 2, convertedChar, 0); convertedChars.Append(convertedChar[0]); } else { convertedChars.Append(c); } } return convertedChars.ToString(); }
Hi vinod,
thank you for this code,
but when i am running it giving me syntax error on
char[] convertedChar = new char[1];
byte[] bytes = new byte[] { 217, 160 };
char[] inputCharArray = input.ToCharArray();
foreach (char c in inputCharArray)
{
i have chenged, but still
please guide me thanks in advance
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Priya_K 4
Martin Dráb 4 Most Valuable Professional
Ali Zaidi 2