Share » Forums » Setup & design » remove CRLF (\r\n) caracters

remove CRLF (\r\n) caracters

remove CRLF (\r\n) caracters

Wednesday 14 December 2005 9:42:05 am - 5 replies

Author Message

Ole Morten Halvorsen

Wednesday 14 December 2005 11:23:01 am

Did you try the <b>trim()</b> operator?

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/strings/trim

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Ole Morten Halvorsen

Wednesday 14 December 2005 2:25:05 pm

My bad. Didn't see you wanted to remove newline characters from the middle of the string :)

I think you would have to make your own operator that does the removal for you.

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

Lydie Soler

Thursday 15 December 2005 12:50:36 am

hi!

yes I have tried the trim operator and as you noticed my problem is with removing caracters in the middle of the string.

ok lets try to create my own... But how do I do this?... where do I have to put my new code....

where can I find the code of the trim operator in order to have an example?

thanks again!!!

Lydie Soler

Thursday 15 December 2005 1:55:01 am

Well I have search.. and I have found an extension that does exactl what I needed: str_replace.

so here is the code that works for my needs:

{set $corps=ezstr_replace("\r","",$corps)}
{set $corps=ezstr_replace("\n","<br/>",$corps)}

Ole Morten Halvorsen

Thursday 15 December 2005 4:12:24 am

That's great.

Didn't know there was a string replace operator available as a contribution :)

Senior Software Engineer - Vision with Technology

http://www.visionwt.com
http://www.omh.cc
http://www.twitter.com/omh

eZ Certified Developer
http://ez.no/certification/verify/358441
http://ez.no/certification/verify/272578

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu