Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Strange whitespace hard to trim off

Re: Strange whitespace hard to trim off

From: C Chang <cschang_at_maxinter.net>
Date: Sat, 11 Jan 2003 22:58:02 -0500
Message-ID: <3E20E7CA.36FD@maxinter.net>


DA Morgan wrote:
>
> C Chang wrote:
>
> > Mark D Powell wrote:
> > >
> > > C Chang <cschang_at_maxinter.net> wrote in message news:<3E1CF430.2E7D_at_maxinter.net>...
> > > > I have a record ( submitted by customer) as M123-1-9. When I count the
> > > > length of it, it has 9 characters. I use -
> > > > Select part , LENGTH(RTRIM(part)) p from ... to remove the whitespace
> > > > off. However I still have 9 after the process. I have tried various
> > > > chr() such as new-line, space, return character, none of them work. I
> > > > tested with SUBSTR(part, 8,2) ||'*" and confirmed it to be a whitespace
> > > > as 9 *. I just could not trim it off. Does anyone have a better
> > > > suggestion?
> > > > C Chang
> > >
> > > The rtrim function defaults to space (blank) as the character to be
> > > trimmed. Use the DUMP function to see what the trailing characters
> > > are and then use RTRIM (other possibilites trim, replace, and
> > > transform) to eliminate them. See the SQL manual chapter on single
> > > row functions for the full syntax.
> > >
> > > HTH -- Mark D Powell --
> > Thanks Mark. I never use the DUMP function and I will try. I have
> > tried with the RTRIM function (LTRIM as well) but it won't trim off the
> > whitespace, because the LENGTH(RTRIM(...)) gave the same lenght as
> > before. By the way, I have Oracle 8.1.6 on NT 4. as example:
> >
> > SELECT part, SUBSTR(part, 9,2) ||'*' c, LENGTH(PART) l,
> > LENGTH(RTRIM(part) pl FROM ...
> >
> > part c l pl
> > ---------- ---- ---- ----
> > MS123-1-9 9 * 10 10
> >
> > C chang
>
> Using your example above you could try this:
>
> SELECT ASCII(SUBSTR(part,2,1) FROM ...
>
> That will give you the ASCII number of whatever character is there.
>
> Daniel Morgan

Thankss DA. I used DUMP function to find out the special character. It is chr(160), which is the whitespace (&nbsp;) been used in HTML. I can RTRIM it off now. However, I need to find out how it got in at first.

C Chang Received on Sat Jan 11 2003 - 21:58:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US