i have a list of sub family names which i am sorting using list.sort()
The subfamily names are like
familyname - 1 - parts
familyname - 2 - parts1
familyname - 3 - parts2
familyname - 11 - parts2
So when i sort, the result is like this
familyname - 1 - parts
familyname - 11 - parts2
familyname - 2 - parts1
familyname - 3 - parts2
We have familyname - 11 - parts2
coming after familyname - 1 - parts
which is understandable as its sorting as a string.
Is there workaround over this?
One way i am thinking is to split the string, store the number into a map with number and the family name. But this approach would fail, when i have another like familyname2 - 1 - parts
Any thoughts?