... like this: "51,52,53,54,55,56,57,58,59 " These values correspond the sizes: "L,M,S,XL,XXL,4XL,5XL,XS,XXXL" You want to read the values in this order: (in other words sort these values ) "XS,S,M,L,XL,XXL,XXXL,4XL,5XL" for further processing. Is my understanding ...