Re: Stripping newline chars?
| From: | Mark Maggelet | Date: | Mon, 20 Nov 2000 19:07:13 +0000 |
| Subject: | Re: Stripping newline chars? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26310@lists.php.net to get a copy of this message | ||
On Mon, 20 Nov 2000 19:31:50 +0200, Lauri Vain (optima@hot.ee) wrote:
>Hello,
>I have a problem and I can't seem to get it fixed :-(
>My database looks like this:
>db_items_id | db_price | db_desc
>
>Now, the price has lots of newline chars at the *end* which aren't
>supposed to
>be there any more, I need to strip them. The number of them varies.
You just want to strip trailing newlines?
try this:
update kiba_items set db_price=left(db_price,length(db_price)-1)
where db_price like '%\n';
- Mark