Contents

CFStringCreateWithSubstring(_:_:_:)

Creates an immutable string from a segment (substring) of an existing string.

Declaration

func CFStringCreateWithSubstring(_ alloc: CFAllocator!, _ str: CFString!, _ range: CFRange) -> CFString!

Parameters

  • alloc:

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

  • str:

    The string from which to create the new string.

  • range:

    The range of characters in str to copy. The specified range must not exceed the length of the string.

Return Value

An immutable string, or NULL if there was a problem creating the object. Ownership follows the The Create Rule.

See Also

Creating a CFString