Instance Method

scanString:intoString:

Scans a given string, returning an equivalent string object by reference if a match is found.

Declaration

- (BOOL)scanString:(NSString *)string intoString:(NSString * _Nullable *)result;

Parameters

string

The string for which to scan at the current scan location.

stringValue

Upon return, if the receiver contains a string equivalent to string at the current scan location, contains a string equivalent to string.

Return Value

YES if string matches the characters at the scan location, otherwise NO.

Discussion

If string is present at the current scan location, then the current scan location is advanced to after the string; otherwise the scan location does not change.

Invoke this method with NULL as stringValue to simply scan past a given string.

See Also

Scanning Characters and Strings

- scanCharactersFromSet:intoString:

Scans the string as long as characters from a given character set are encountered, accumulating characters into a string that’s returned by reference.

- scanUpToCharactersFromSet:intoString:

Scans the string until a character from a given character set is encountered, accumulating characters into a string that’s returned by reference.

- scanUpToString:intoString:

Scans the string until a given string is encountered, accumulating characters into a string that’s returned by reference.