Countlines (text [, asciiDelimiter])

Result Type: number

Definition: Returns the number of lines in the text string. By default the end of line character is "\n", but a different character can be used if passed as the optional second parameter.

Examples:  Where text = "Line 1\tA\nLine2\tB\nLine 3\tC"


returns 3 (the number of lines)

CountLines(text, "\t")

returns 4 (there are 3 tab characters, giving 4 "lines")

CountLines(text+"\t", "\t")

returns 4. The last character is the same as the delimiter, so is not counted.