Contents

enumerateLines(_:)

Enumerates all the lines in the string.

Declaration

func enumerateLines(_ block: @escaping (String, UnsafeMutablePointer<ObjCBool>) -> Void)

Parameters

  • block:

    The block executed for the enumeration.

    The block takes two arguments:

    line

    The current line of the string being enumerated. The line contains just the contents of the line, without the line terminators. See Getlinestart(_:end:contentsend:for:) for a discussion of line terminators.

    stop

    A reference to a Boolean value that the block can use to stop the enumeration by setting *stop = YES; it should not touch *stop otherwise.

See Also

Finding Characters and Substrings