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.
now if distincts default compare not work can create custom iequalitycomparer
mike
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment