Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: trim(both) ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 7 Topic 3438 of 3799
Post > Topic >>

Re: trim(both) problem?

by tgl@[EMAIL PROTECTED] (Tom Lane) Apr 25, 2008 at 05:26 PM

"Fernando Hevia" <fhevia@[EMAIL PROTECTED]
> writes:
>> Trim doesn't do what you think it does. The '<BR/>' in the 
>> above is not a string to remove it is a list of characters to 
>> remove.  Thus, the R is removed as it matches a character given.

> You could probably use instead:

> select replace('<BR/>ROI Engineering Inc.', '<BR/>', '')

That would zap occurrences in the middle of the string, though.
regexp_replace would be better since it'd allow anchoring the
pattern, eg

select regexp_replace('<BR/>ROI Engineering Inc.', '^<BR/>', '');
select regexp_replace('ROI Engineering Inc.<BR/>', '<BR/>$', '');

			regards, tom lane

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 7 Posts in Topic:
trim(both) problem?
emilu@[EMAIL PROTECTED]   2008-04-25 16:33:49 
Re: trim(both) problem?
tgl@[EMAIL PROTECTED] (T  2008-04-25 16:44:30 
Re: trim(both) problem?
sszabo@[EMAIL PROTECTED]   2008-04-25 13:45:59 
Re: trim(both) problem?
fhevia@[EMAIL PROTECTED]   2008-04-25 18:03:14 
Re: trim(both) problem?
tgl@[EMAIL PROTECTED] (T  2008-04-25 17:26:27 
Re: trim(both) problem?
emilu@[EMAIL PROTECTED]   2008-04-28 09:19:03 
Re: trim(both) problem?
chestercyoung@[EMAIL PROT  2008-04-25 14:48:26 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 22:08:38 CST 2008.