List<string> complex sorting
问题 I have a List<string> of sizes, say XS, S, M, L, XL, XXL, UK 10, UK 12 etc What I want is to force the order to be that of above, regardless of the order of items in the list, I think I need a IComparable operator but unsure. Ideally I want to have another List with the correct order in which it can reference it's 'place' in the list and re-sort itself, if it doesn't exist it will default to A-Z 回答1: Create an array of sizes in the order you want them to be in, then sort the shirts by the