Instance Method

enumerateLinesUsingBlock:

Enumerates all the lines in the string.

Declaration

- (void)enumerateLinesUsingBlock:(void (^)(NSString *line, BOOL *stop))block;

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:forRange: 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

- containsString:

Returns a Boolean value indicating whether the string contains a given string by performing a case-sensitive, locale-unaware search.

- localizedCaseInsensitiveContainsString:

Returns a Boolean value indicating whether the string contains a given string by performing a case-insensitive, locale-aware search.

- localizedStandardContainsString:

Returns a Boolean value indicating whether the string contains a given string by performing a case and diacritic insensitive, locale-aware search.

- rangeOfCharacterFromSet:

Finds and returns the range in the string of the first character from a given character set.

- rangeOfCharacterFromSet:options:

Finds and returns the range in the string of the first character, using given options, from a given character set.

- rangeOfCharacterFromSet:options:range:

Finds and returns the range in the string of the first character from a given character set found in a given range with given options.

- rangeOfString:

Finds and returns the range of the first occurrence of a given string within the string.

- rangeOfString:options:

Finds and returns the range of the first occurrence of a given string within the string, subject to given options.

- rangeOfString:options:range:

Finds and returns the range of the first occurrence of a given string, within the given range of the string, subject to given options.

- rangeOfString:options:range:locale:

Finds and returns the range of the first occurrence of a given string within a given range of the string, subject to given options, using the specified locale, if any.

- localizedStandardRangeOfString:

Finds and returns the range of the first occurrence of a given string within the string by performing a case and diacritic insensitive, locale-aware search.

- enumerateSubstringsInRange:options:usingBlock:

Enumerates the substrings of the specified type in the specified range of the string.