What is the best way to split some given larger number into hundreds, tens and units in C#?
For example: If I enter number 43928 how can I get 40000 + 3000 + 900 + 2
Something like this:
long x = 43928; long i = 10; while (x > i / 10) { Console.WriteLine(x % i - x % (i / 10)); i *= 10; }
it will give you output
8 20 900 3000 40000