Instance Method

scanString(_:into:)

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

Declaration

func scanString(_ string: String, into result: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool

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

true if string matches the characters at the scan location, otherwise false.

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

func scanCharacters(from: CharacterSet, into: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool

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

func scanUpToCharacters(from: CharacterSet, into: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool

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

func scanUpTo(String, into: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software