FREE OutSystems Workshops - Build an OutSystems App in 1 hour | ENROLL NOW

NewLine()

< Back to OS Goodies

When parsing a text file, you sometimes use the String_Split to split the file into a List of lines.

Do not use NewLine() as the pattern. The reason for that is because NewLine() is a string with two characters: Carriage Return (with ASCII code 13) and Line Feed (with code 10). So if your text has the two characters at the end of each line, you will have the text split by both characters and will end up with double the lines.

So, use Chr(10) instead to search only for the Line Feed since that is the one character at the end of the line in any text file.

Also, if later you want to concatenate the strings to form the text again with lines, do not use NewLine() because now you will get at the end of each line the characters 13, 13, and 10, which again will translate to two lines since the code 13 alone is considered a new line.

Development

Choose ITUp to Enhance your OutSystems Skills!

Our Courses