How to arrange list of data in another list

Suppose I have a list of data X=(1g,2b,2g,3b,5y,8y,7b)
How to arrange like this
g=(1g,2g)
b=(2b,3b,7b)
y=(5y,8y)

thank in advance

Use ListUtilz extension to get filtered list by certain keyword.

1 Like