Here’s a Ruby snippet to remove all half-width and full-width spaces from strings.

'a b c'.gsub(/(\\s| )+/, '')
=> "abc"
What this does is use the gsub method with a regular expression to replace half-width or full-width spaces with empty strings.
That’s all from the Gemba.