Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Removing multiple spaces from a string
SQL> help replace
REPLACE
SYNTAX:
REPLACE(char, search_string [,replacement_string])
PURPOSE:
Returns char with every occurrence of search_string replaced with
replacement_string. If replacement_string is omitted or null, all
occurrences of search_string are removed. If search_string is null,
char is returned. This function provides a superset of the
functionality provided by the TRANSLATE function. TRANSLATE
provides single character, one to one, substitution. REPLACE allows
you to substitute one string for another as well as to remove
character strings.-----Original Message-----
Sent: Monday, February 19, 2001 11:05 AM
To: Multiple recipients of list ORACLE-L
There must be an easy way to remove multiple spaces from a VARCHAR2, but I can't think of one apart from running replace(string,' ', ' ') many times. I'm parsing a large string of text, with all sorts of punctuation and multiple spaces interspersing the words. Any help gratefully received
Thanks, Mike Monaghan
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: MONAGHAN, Mike
INET: Monagham_at_oup.co.uk
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Mon Feb 19 2001 - 16:08:36 CST