How can I compare two strings and remove duplicated?


Here is what I want.

StrVar1=“Apple Banana Orange Mango Melon”
StrVar2=“Banana Orange Mango Melon Kiwi

I want “Kiwi” from StrVar2

How to delete duplicated words in StrVar2 ?

Hi @Golf_Aquascape

Try this

String.Join(" ",Input2.Split(" ".ToCharArray()).Except(Input1.Split(" ".ToCharArray())))

Hope this helps!!

Was great. thanx!! :slight_smile:

1 Like

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