How to remove spaces in an acronym in SQL?

Viewed 270

I want to write a function that removes spaces between isolated letters, like in an acronym.

For example, if I have:

'I B M Computers' i need to have in return 'IBM Computers'
' I B M ' => 'IBM'
'Computers A B' => 'Computers AB'
'Computers A BC' => 'Computers A BC' (nothing changes)
'Computers A B CD' => 'Computers AB CD'
'Computers A B C D' => 'Computers ABCD'

I can't find a way to do that properly, can someone help me please ?

Thanks.

3 Answers
Related