trim does not take off the line breaks
Moderator: General Moderators
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
trim does not take off the line breaks
trim function does not take off the line breaks...what is the function or any available way to strip off all the spaces and line breaks from a string stored in the DB using Mysql.
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
Re: trim does not take off the line breaks
Yes it does!?raghavan20 wrote:trim function does not take off the line breaks...what is the function or any available way to strip off all the spaces and line breaks from a string stored in the DB using Mysql.
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
i hope you have read that i have mentioned in mysql.
I am working purely with mysql procedures.
ex:
I am working purely with mysql procedures.
ex:
Code: Select all
select concat(trim( ' sdfsf
'), '##');
+---------------------------------------------------------------+
| concat(trim( ' sdfsf
'), '##') |
+---------------------------------------------------------------+
| sdfsf
## |
+---------------------------------------------------------------+
1 row in set- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
try this...
Code: Select all
SELECT concat(trim(REPLACE(' sdfsf
, '\\n', '')), '##');- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
i changed it a bit...looks like working...thanks for your idea..
Code: Select all
SELECT concat(trim(REPLACE(' sdfsf
', '\r\n', '')), '##');
+----------------------------------------------------------------------------------+
| concat(trim(REPLACE(' sdfsf
', '\r\n', '')), '##') |
+----------------------------------------------------------------------------------+
| sdfsf## |
+----------------------------------------------------------------------------------+
1 row in set
