3
我想幫助比較兩個數組的用戶,並拋出兩個數組中存在或匹配的用戶,然後將結果扔到最終數組中。例如:在比較數組時,刪除匹配項
###define arrays
$array1 = @("bill","eric","james","sarah")
$array2 = @("bill","scott","sarah","nancy")
###Combine/Filter? arrays and remove users that exist in both arrays
$result = ($array1 + $array2 | some fancy match removal goes here)
$result
eric,james,scott,nancy
我想確保匹配從兩個數組合並時完全刪除。所以如果兩個陣列中都存在「sarah」,我想把她完全從最終結果中刪除。那可能嗎?
這是太棒了 - 非常感謝你的幫助 – Intrepdmind