Remove duplicates from string

String -
Experience
Experience
Business Development Intern
Business Development Intern
Sun Technologies · Internship
Sun Technologies · Internship
Aug 2023 - Present · 2 mos
Aug 2023 - Present · 2 mos
Kothrud
Kothrud

In above string there is double lines. How to remove those duplicates from string in UiPath?

@Anil_G @Sudharsan_Ka @supermanPunch

Hi @pravin_bindage

Please take a look at the following approach:

Step 1 → yourString.Split({vbCrLf}, StringSplitOptions.RemoveEmptyEntries)

Step 2 → linesArray.Distinct().ToArray()

Step 3 → String.Join(vbCrLf, uniqueLinesArray)

Hope this helps,
Best Regards.

We assume, that the string is along with line breaks

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