Remove duplicate domain from a listbox

Taylor Farrell

New member
Joined
Nov 8, 2024
Messages
1
Points
1
Hi,

I would like to ask..

How do I remove duplicate domain in a listbox?
This is my code and I want it to remove duplicate domain from a listbox that has been loaded before.
 

Dolly West

New member
Joined
Nov 8, 2024
Messages
1
Points
1
Add all urls to an string[] url_array and create an empty List<string> outputlist
then do a foreach with your url_array and check if your outputlist contains Regex.match(currenturl,"[^/]*"), use anotehr foreach loop for that. If there are no matches add the url to the outputlist.
This will do this job for you.
 
Top