![]() |
CFStringFindWithOptions | Header: CFString.h |
Searches for a substring within a range of the characters represented by a CFString object and, if the substring is found, returns its range within the object's characters.
Boolean CFStringFindWithOptions ( CFStringRef theString, CFStringRef stringToFind, CFRange rangeToSearch, CFOptionFlags searchOptions, CFRange *result );
Pass a reference to the CFString object to be searched.
Pass a reference to the CFString object containing the substring to search for in theString.
Pass the range of the characters to search in the CFString object referenced by theString.
Pass a bitfield of type CFOptionFlags containing one or more comparison-option flags (OR'd together if multiple) or, if you want no options, pass zero. The
Pass an uninitialized CFRange structure (or initialized to (0,0)). On return, if the function result is TRUE, result contains the starting location and length of the found substring. You may pass NULL if you only want to know if the substring exists in the larger string.
TRUE if the substring was found, FALSE otherwise.
The CFStringFindWithOptions function allows you to search only part of the characters of a CFString object for a substring. It returns the found range indirectly, in the final result parameter. If you want to know if the entire range of characters represented by a CFString object contains a particular substring, you can use the convenience function
Depending on the comparison-option flags specified, the length of the resulting range might be different than the length of the search string.