4 Replies Latest reply on May 19, 2016 1:50 PM by user24799

    How can I prevent this custom function from removing my text formatting?

    user24799

      I found this custom function "FormatOneLine" that strips out all carriage returns and extra spaces...but it's also removing my custom text formatting that I would like to retain. Can someone please tell me what part of this custom function I can delete so it only removes the carriage returns and extra spaces?

       

      Thanks.

       

      Let (

       

      // Remove up to multiple returns, tabs, and spaces

      [

      tempText = Substitute (Text;

      ["¶¶"; "¶"]; ["¶¶"; "¶"]; ["¶¶"; "¶"]; ["¶¶"; "¶"]; ["¶¶"; "¶"];

      ["    "; " "]; ["    "; " "]; ["    "; " "]; ["    "; " "]; ["    "; " "]; // tab characters

      ["  "; " "];["  "; " "];["  "; " "];["  "; " "];["  "; " "] );

       

      // Remove return from beginning if there to prevent blanking out

      tempText1 = If(Left (tempText; 1) ="¶"; Right(tempText; Length(tempText)-1) ; tempText)

      ];

       

      // Remove all text formatting and make one line without leading spaces

      Evaluate (

      Quote (

      Trim (

      If(Position(tempText1;"¶";1;1)>0;

      Left(tempText1; Position ( tempText1 ; "¶" ; 1 ; 1 )-1); tempText1)

      ))))