5 Replies Latest reply on Jun 3, 2016 5:56 AM by WolfShade

    Need to Insert linebreak after 64 letters in a long string.

    Lakshmikanth S_13

      Hi Friends,

       

      I am knew to CF - 11..I am trying to insert line break after 64 letters and dont know how to change below line. Kindly help. and also if possible please explain below line.

      <cfset outstr &= Mid(instr,p,64) & #Chr(13)#>

       

       

      Thanks

       

      My code as follows.

       

      <cfset instr = rereplace(arguments.value,"#chr(10)#","","all")>

          <cfset instr = rereplace(instr,"#chr(13)#","","all")>

        <cfset instr =trim(instr)>

      <cfloop from="1" to="#len(instr)#" index="p" step="64">

      <cfset outstr &= Mid(instr,p,64) & #Chr(13)#>

      </cfloop>

       

      currently I an getting a long string with a space after 64 letters as output.