Link to home
Start Free TrialLog in
Avatar of lmymusic2000
lmymusic2000

asked on

How to trim in between blank spaces of a character string in Oracle

Hi All,
I would like your idea and input on how to trim the blank spaces in between a character string in Oracle. For example I have this character strings as 'I go to sleep' how can I make it to become 'Igotosleep'. I try the trim function but it does not work.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sean Stuber
Sean Stuber

replace(yourstring,' ')
try this: select replace('THIS IS a test.', ' ', NULL) from dual;
SELECT REPLACE("Your String", CHR(32), '') FROM DUAL will replace any blank spaces in the given string
Why make an additional function call when it is not needed?
Avatar of lmymusic2000

ASKER

You nail it, slightwv. Thanks