How to remove duplicate values from a string in Pega

I have a comma separate value sting which may contain duplicates. How can i remove them

Eg: If my sting is ABC,XYZ,ABC- I need an output of ABC,XYZ

Can anyone suggest on this?

@A.V.N.S.M.P.KAVYS Not sure if there is an easier way but you can give this is a try:

  1. Convert the csv to pagelist using function “pxPageListFromStringCSV”

  2. call function pzRemoveDuplicatesFromListPage to move duplicates

  3. Convert the pagelist to csv by calling function pxStringCSVFromPageList

@A.V.N.S.M.P.KAVYS

Can you please try the below regular expression along with pxReplaceAllViaRegex fucntion,

regular expression: \b([^,]+)(?=.*,\1\b),

pxReplaceAllViaRegex(Param.input,“\b([^,]+)(?=.*,\1\b),”, “”)

@kishoreb7398 , Thank you for the suggestion. It is working for me and solved my requirement.

Thanks.