Delete Duplicate Value

Hi all,

I was wondering what is the best way to remove duplicate word in a string. For example “London London”

1 Like

I would use a regex statement but there are probably a few approaches.

Use the Matches activity and add the regex syntax provided.

hello @Stabbathehut
A simple approach would be to use Distinct Method

try this code out

String.Join(" ",StringInputVariable.Split(" "c).Distinct)

3 Likes

@vickydas That’s great! Building from this how do you add to an if statement? If its a duplicated string then type a formatted removed string into an area?

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