How can we get the distinct values in a string?

Hi Team,

Can we get the distinct values.
distinct-values(“a a b b c c c”)
join(" ",distinct-values(“a a b b c c c”))
it should return-> a b c

Is this a word you are trying to control or a alphabet (character) you are trying to control?

I am trying in the string.
Example:- join(" ",distinct-values(“a a b Kobo c c c”))
It should return → a b Kobo c

Please help in this