I have the following string: 0000015700
I need an algorithm that does the following:
- goes to the first digit other than
0from right to left (7, in this case) - extracts 6 digits starting from
7going right to left (output would be000157
It cannot be implemented using LINQ, since the project is running on the .NET 2.0 framework.
How do I do this in C#?
First you should trim end of string, and then get a required substring: