CFStringCreateArrayWithFindResults

Header: CFString.h Carbon status: Supported

Searches a CFString object for multiple occurrences of a substring and creates an array of ranges identifying the locations of these substrings within the target string.

CFArrayRef CFStringCreateArrayWithFindResults (
    CFAllocatorRef alloc, 
    CFStringRef theString, 
    CFStringRef stringToFind, 
    CFRange rangeToSearch, 
    CFOptionFlags compareOptions
);
Parameter descriptions
alloc

Pass a reference to the allocator used to create the CFArray object or pass NULL to request the default allocator.

theString

Pass a reference to the CFString object to search for the substring.

stringToFind

Pass a reference to a CFString object containing the substring to search for.

rangeToSearch

Pass the range of characters within the source CFString object to be searched.

compareOptions

Pass one or more search-option flags (OR'd together if multiple).

function result

A reference to a CFArray object that contains CFRange structures identifying the character locations of the requested substring in the source CFString object. If no matching substring is found in the source object, or if there was a problem creating the CFArray object, the result is NULL.

DISCUSSION

The CFStringCreateArrayWithFindResults function searches through all characters of a CFString object for one or more occurrences of a specified substring. If there are any matches, the function creates a CFArray object that holds the ranges (as CFRange structures) identifying the locations of the substrings within the target CFString object. It returns a reference to the CFArray object.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)