Function

CFAttributedStringCreateWithSubstring

Creates a sub-attributed string from the specified range.

Declaration

CFAttributedStringRef CFAttributedStringCreateWithSubstring(CFAllocatorRef alloc, CFAttributedStringRef aStr, CFRange range);

Parameters

alloc

The allocator to use to allocate memory for the new attributed string. Pass NULL or kCFAllocatorDefault to use the current default allocator.

theString

The attributed string to copy.

range

The range of the attributed string to copy. range must not exceed the bounds of aStr.

Return Value

A new attributed string whose string and attributes are copied from the specified range of the supplied attributed string. Returns NULL if there was a problem copying the object. Ownership follows the The Create Rule.

See Also

Creating a CFAttributedString

CFAttributedStringCreate

Creates an attributed string with specified string and attributes.

CFAttributedStringCreateCopy

Creates an immutable copy of an attributed string.

CFAttributedStringGetLength

Returns the length of the attributed string in characters.

CFAttributedStringGetString

Returns the string for an attributed string.