Andreas Kretschmer wrote on 28.10.2007 13:32:
But it seems my problem was actually caused by something else:
SELECT regexp_replace(myfield, '\s*', '', 'g')
FROM mytable;
you should escape the \, change to ...'\\s*'...
Ah! Didn't think this was necessary, as \t or \n did not need to be escaped
Thomas Kellerer <[EMAIL PROTECTED]> schrieb:
> Andreas Kretschmer wrote on 28.10.2007 12:42:
> >>I have a column with the datatype "text" that may contain leading
> >>whitespace (tabs, spaces newlines, ...) and I would like to remove them
> >>all (ideally leading and trailing).
> >You can use tr
Andreas Kretschmer wrote on 28.10.2007 12:42:
I have a column with the datatype "text" that may contain leading
whitespace (tabs, spaces newlines, ...) and I would like to remove them all
(ideally leading and trailing).
You can use trim() for that:
select 'x' || trim(both '\t' from trim(both
Thomas Kellerer <[EMAIL PROTECTED]> schrieb:
> Hi,
>
> I have a column with the datatype "text" that may contain leading
> whitespace (tabs, spaces newlines, ...) and I would like to remove them all
> (ideally leading and trailing).
You can use trim() for that:
select 'x' || trim(both '\t' fr