Xbasic

REMOVE_BLANK_LINES Function

Syntax

Compacted_List as C = Remove_Blank_Lines(C Source)

Arguments

SourceCharacter

A CR-LF delimited character string list containing 0 or more lines with NULL (blank) content.

Returns

Compacted_ListCharacter

Returns CR-LF delimited list with all blank lines removed.

Description

Removes blank lines from the string.

Discussion

REMOVE_BLANK_LINES() removes all lines in a CR-LF delimited list that have NULL ("") content. Lines that contain invisible characters, such as spaces (" ") will not be removed.

Example

dim cs as C

cs = "abc" + crlf() + "" + crlf() + "def" + crlf()
? cs
= abc

def

CS = remove_blank_lines(cs)

? cs
abc
def

See Also