I am faced with the following issue. I need to capture a range of serial numbers in c# to be stored in a database. If these serial numbers are just numbers, it is fine, but I have ran into serial numbers which are alpha-numeric such as:
56AAA71064D6 and 56AAA7105A25
How can I accommodate the different possibilities that serial number ranges may be in?
Assuming that all serial numbers have some order, how can I parse the sequential part of it?
The database takes the serial numbers as strings already.
If your serial numbers have same width then its easy…
you have to use string.compare method to get the range.
And if you sort all serial numbers, then you can easily pickup range.
If they are not of same width then you have to padd 0 before smaller length strings to make them all same size.