Search code examples
coldfusionword-wrap

Does the Wrap function in ColdFusion insert CR/LFs?


I have the need to do some word wrapping with a few considerations:

  1. Source file is MS WORD

  2. Copy and paste the text into a textarea in a cfform.

  3. Use

    #wrap(theTextVar,80)#
    to dump out the text 80 characters

  4. The text is uploaded to a legacy system which needs ansi or ascii chars uploaded.

Everything seems to work okay, I just wanted to confirm see if anyone else has had luck doing this and if they know if a CR / LF is entered after each line in the outputted text (Step 3)?


Solution

  • From the docs on wrap():

    Uses the operating-system specific line break: newline for UNIX, carriage return and newline on Windows.

    So if you are doing this on a Windows box, then the answer is yes.