Go to the first, previous, next, last section, table of contents.


countLinesInString

Function: countLinesInString { string -> integer }
file: job.t
package: muf
status: alpha

The countLinesInString function is a trivial convenience function returning the number of newlines in the string, plus one if the last character is not a newline. It is coded in-db mostly because doing so is easy, and the function is likely to be frequently used.

Examples:

stack:
"abc\ndef" countLinesInString
stack: 2
pop "abc\ndef\n" countLinesInString
stack: 2

See section getLineFromString.


Go to the first, previous, next, last section, table of contents.