Is there a way to nest one of these (Crystal Reports)

I need to use these two formulas for one field. Can someone help me combine them?



stringvar input: = {tbl.col};
stringvar output: = '';
numbervar i;

input: = Trim (input);

for i: = 1 to Length (input) Step 1 do 
if not (input [i] in [Chr (13), Chr (10)]) then 
   output: = output + input [i]; output;

if right ({tbl.col}, 1) = "]" then
   left ({tbl.col}, instr ({tbl.col}, "[") - 1)
else 
   {tbl.col};

Any suggestions if I want to use this code first, then remove spaces / line breaks? // stringvar array x: = split ({Police.Narrative}, "]"); // numbervar i; // numbervar j: = ubound (x); // stringvar y: = ""; // for i: = 1-j-1 do (// y: = y + trim (extractstring (x [i], "," [")) +"; "//); // if len (y )> 2, then // left (y, len (y) -2);

0


a source to share


1 answer


Instead of looping to remove spaces and line breaks, you should use the Replace function.



0


a source







All Articles