How remove duplicates character in string variable?

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Replace(yourString,"(.)\1+","$1")

Regards,