Function to compare strings, with numbers sorted properly.