Pages

30 November, 2023

compare two array and exclude the common one and show the result

my first array contains line of strings(this list contains 456454), which needs to be compared with an array(456454, 456789).


$unprotected - "this list contains 456454" $blocklist - @('456454', '456789')


foreach ($ele in $blocklist)
{
foreach ($elem in $unprotected)
{
if ($ele -contains $elem)
{}
else {$var_chk = "1"}
}
} if($var_chk = "1"){$Arr_lst += $elem}

No comments:

Post a Comment

Thanks