Sort text with custom order?

Hi all,

Just wondering, is it possible to sort bunch of text with desire order?
Like the image attach below.
To be more specific, instead of (A101,A201,B101,B201B,R01) can I modify it to (B201,B101,A101,A201,R01) ?

Thanks a lot.


SORT TEXT.gh (10.6 KB)

What is the logic of this sequence?

Sorry for not clear, what I meant is, instead of alphabetical order (a,b,c,d,…) can I make my own order? (I.e. b,a,c,d,r,…) And same for the number.

I think what @maje90 is getting at is: Can you define your desired sequence in terms of a logical instruction to grasshopper. Sounds more like you want to be able to drag & drop items arbitrarily to make your list.

If your index numbers are always associated with the same list item then you can probably create a new list and use the index to sort items, but unless there’s some logic to your desired ordering it would mean manually doing it for every single item.