How to break up a ColdFusion Variable on a '-' sign.

Posted on 2011-05-04
Medium Priority
Last Modified: 2012-06-27
I have variables that contain '-'. Example, the variable #unitName# is ADM-OPS-ITS-IS-AED. I want to force a line break after the hyphens... How would I do this?
Question by:traport
  • 2
  • 2
LVL 52

Expert Comment

ID: 35692280
Try listChangeDelims

<cfset unitName = "ADM-OPS-ITS-IS-AED">
#listChangeDelims(unitName, "<br>", "-")#

Author Comment

ID: 35692326
That is almost what I want. I don't want to lose the -, I just want to <br> after it. Thank you!
LVL 52

Accepted Solution

_agx_ earned 1000 total points
ID: 35692336
Ok. Just add a "-" before the "<br>"

#listChangeDelims(unitName, "-<br>", "-")#

Author Closing Comment

ID: 35692416
Thank you!

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question