How to acheive this in asp.net core without using javascript.
|
|
Output

How to acheive this in asp.net core without using javascript.
|
|
Output

Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh KumarRank #91 · 22.9K reputationPosted Sep 15, 2022, 12:26 AM EDT
Hi KavyaM,
Please use Except finction to get difference between two strings,
string s1 = "The red brown fox jumped over"; string s2 = "The brown spotted fox leaped over"; IEnumerable set1 = s1.Split(' ').Distinct(); IEnumerable set2 = s2.Split(' ').Distinct(); var notExistsInSet2AndExistInSet1 = set1.Except(set2).ToList(); var notExistsInSet1AndExistInSet2 = set2.Except(set1).ToList();Vishal YelveRank #178 · 13.6K reputationPosted Sep 15, 2022, 1:38 AM EDT
string s1 = "The red brown fox jumped over"; string s2 = "The brown spotted fox leaped over"; List diff; IEnumerable set1 = s1.Split(' ').Distinct(); IEnumerable set2 = s2.Split(' ').Distinct(); if (set2.Count() > set1.Count()) { diff = set2.Except(set1).ToList(); } else { diff = set1.Except(set2).ToList(); }