Remove duplicate strings - C#

Here is the code
1
2
3
var words = new HashSet();
string text = "praveen kumar thalluri praveen kumar thalluri";
text = Regex.Replace(text, "\\w+", m => words.Add(m.Value.ToUpperInvariant())? m.Value: String.Empty);

Comments

Popular posts from this blog

Nintex Forms (on-prem) Web Request Control Internals

How to remove Azure Access Package User assignments using Graph API?

SharePoint 2010 Search - search by enterprise keywords