How remove duplicates character in string variable?

I have 2 variables:
1.“11222334444”
2.“122qqe3312qe3”

if possible, both lines with the same algorithm

Hi @Vlad_Svitelskyi

Welcome to UiPath community

String.Join("",StringInput.Distinct)

Check out the XAML file

Remove DuplicateCharacter.xaml (4.8 KB)

image

Regards
Gokul

1 Like

Hi,

How about the following expression?

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

Regards,

use assign activity
str= String.Join(“”,str.Distinct())

what about second string?

@Vlad_Svitelskyi Here is the second one

Happy Automation

Regards
Gokul

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.