Proposed array function swap

Added proposed array function 'swap' that would swap all matches with given variable.