I have a list with IP Addresses and I need to eliminate the IPs that do not correspond to my network, which are "198.1".
class HostInfo
{
public List<IPAddress> Addresses { get; set; }
}
When the IPs are added, some are made from one column and others from two, I need to be able to filter or eliminate the IPs that start with "198.1"
Taking some help from this question a solution could be:
change your property to be something like this:
where you would not really be deleting the ones that are not but filtering the ones that are, and assigning them back to the original list, but the result is as expected, or not?
you should add the following using if you don't already have it...