Home    Reference > F Functions > Lines
prev next

Description

The Lines iterator iterates over each line of string. Lines are separated by eol characters.

Function Line[ ]

@x:func Line[str~string](act)
str a string to be iterated over. This parameter is a Stream Sink. When optimization is on, the implementation will in some cases start up a separate thread to evaluate this parameter.
act the iterator body function. It takes a single parameter of type string which is a single line of the string.

Semantics

This is an iterator function that iterates over all lines of a string.

Examples


   @x:for line := Lines[fname.read#file()] {
      g(line)
   }