Created
February 15, 2021 18:34
-
-
Save ArminShoeibi/7ef3e97368d44f36bdda73761b11c7a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ConvertNumberExtensions | |
| { | |
| public static string ConvertDigitChar(this string str, CultureInfo source, CultureInfo destination) | |
| { | |
| for (int i = 0; i <= 9; i++) // from number 0 to 9 | |
| { | |
| str = str.Replace(source.NumberFormat.NativeDigits[i], destination.NumberFormat.NativeDigits[i]); | |
| } | |
| return str; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment