Sorting

Numerical string sorting …

The problem: You have an unsorted array of strings (product codes, area codes, etc.) containing both letters and numbers (for example 'A28', 'A3', 'A1', etc.) and you want to sort them numerically (that is, 'A1', 'A2', ..., 'An'). Ruby offers a sort method, so let's see what it does...

Nope, that's …