Skip to content

Instantly share code, notes, and snippets.

@ArminShoeibi
Created February 15, 2021 18:34
Show Gist options
  • Select an option

  • Save ArminShoeibi/7ef3e97368d44f36bdda73761b11c7a7 to your computer and use it in GitHub Desktop.

Select an option

Save ArminShoeibi/7ef3e97368d44f36bdda73761b11c7a7 to your computer and use it in GitHub Desktop.
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