How to compare two strings and score the output


I need to compare two strings like skills=“java,c++,c#” with skillset=“java,j2ee”. In both the string java is common so it should produce output as in interger value 1… Already I tried to split the string in List but the syntaz is not working for me…If anyone knows help me out


listMatch= Split(string2,“,”).Intersect(Split(string1,“,”)).ToList()

perform your logic after this (foreach based on count)


yup tq vvaidya but if i have stings as string1=“marketing,sales” and string2=“marketing management,sale management” and I converted those stings in List passed loops but it generates count=0, i need count=2… and anyone know how to sort list

  1. marketing is not an individual value in string2
  2. string1 has sales and string2 has sale
  3. you can replace space by comma and use contains in if condition.

Hope it helps.

I tried contains… still it is not working…

This may help:

@badita Can you make the external urls open in a new tab (I’m using chrome).

@vvaidya you can set those in your user profile to always open in new tab


Thanks @andrzej.kniola. Didn’t know that, will check out.

im attaching my file… please look into it and give me suggestions to get approximate score countcompare.xaml (28.6 KB)

hi vvaidya

using intersect how can i trim strings within string1 and change the cases… because of the whitespace and case strings are not getting matched… can u please help me