Brian & Laura McGarvie
Welcome to Brian and Laura McGarvie’s homepage, find out more information on Brian M McGarvie and his it consultancy, and about our personal adventures and experiances…

ColdFusion - replace nl to br

March 10th, 2008 by Brian M McGarvie

Just a quickie if you need to replace NL (New Line or Carriage Return) in CFMX;

<cfset text = replace(text,'#Chr(10)##Chr(13)#','<br>',"All")>

You could also wrap it up in a CFC or a function if it’s going to be widely used.

Posted in All The Rest

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.