MorganS:
22uF is kind of large but it should work effectively. A more normal number would be 0.1uF or even as small as 22pF (0.000022uF)
Its risking welding the switch contacts closed, so if you are forced to use it add 100 ohm resistor in series
with the switch to limit the current.
Note that the capacitor must be at the Arduino end of the cabling run, not the switch end.