Remove multiple lines of string in output

I am trying to create a dynamic file location using an assign. All the correct information is there however when i view the output of the assign, it puts it into two lines. Not sure how to make it just one line. It is throwing an error when trying to use the file location in my write text file.

depending from where your data is coming from give a try on

yourStringVar.Replace(vbCrLf,β€œβ€)
yourStringVar.Replace(vbCr,β€œβ€)
yourStringVar.Replace(vbLf,β€œβ€)

Hey

Try to output it as: yourVariable.trim

Regards

Where is the value coming from? Show us the Assign.

I tried that and it didn’t fix it.

did you try the Linebreak replacements?

also you can check for
β€œC…” + var1.Trim() + β€œβ€¦β€ + var2.trim() + β€œβ€¦txt”

I used the first one and i believe it worked. Can you briefly explain what that did? Thank you for the help.

vbCrLf is Constant representing a typical Windows Linebreak which is composed by Cr - Carriage Return character (\r) and LF-Line Feed (\n)

we used this for a replacement with β€œβ€ - empty string

1 Like

Yeah but how is he ending up with a carriage return in his string? Your workaround will work, but I think it’s important to find the real root of the problem.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.