@Scott_UK Try this:
Concat(Distinct(Trim(Split(TextInputCanvas1.Value,",")),Value),Value,",")
In my case, the input for TextInuptCanvas1.Value is:
1,1,1,2,2,2,3,4,5,6,7,8,9,9,9,0,0,0,1,1,3,3,4,5,6,7,8,9,10,11,12,13,14,11,11,12,and,AND,aND,And, And,And
And my output using the code I posted is:
1,2,3,4,5,6,7,8,9,0,10,11,12,13,14,and,AND,aND,And