Deleting duplicate values from a collection?


...or better way of doing this.

i'm using regexes search html file tags using

        public static string threadposterspattern          {                           {                  return "<span class=\"postername\">(.*)(?=</span>)";              }          }

matchcollection posterlist = regex.matches(filecontents, threadposterspattern, regexoptions.multiline); foreach (match x in posterlist) {

//this cleans extraneous sub-tags results var y = new regex("<.*?>").replace(x.value, string.empty); console.writeline(y); }


now, want remove duplicate entries posterlist , turn whole list 1 delineated string {eventually} insert sqlite database. apparently there's distinct(){?} method along lines, i'm not sure how reach point.

c# newbie, learning on go. ask lot of followup questions answers given, fair warning , all.

you can use distinct function of linq remove duplicates matchcollection

take @ awnswer.

http://stackoverflow.com/questions/666241/how-can-i-get-a-regex-match-to-only-be-added-once-to-the-matches-collection

now if distincts default compare not work can create custom iequalitycomparer

mike




Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

SQL Server 2008 - High Memory Usage

Problem In Configuring Biztalk 2009 In Creating A ReceivePort.When I Try To Create A Receive POrt I Got This Error

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts