Contents

CFURLCopyPathExtension(_:)

Returns the path extension of a given URL.

Declaration

func CFURLCopyPathExtension(_ url: CFURL!) -> CFString!

Parameters

  • url:

    The CFURL object to examine.

Return Value

The path extension of url, or NULL if no extension exists. Ownership follows the create rule. See The Create Rule.

Discussion

The path extension is the portion of the last path component which follows the final period, if there is one. For example, for http:/www.apple.com/developer/macosx.today.html, the extension is html, and for http:/www.apple.com/developer, there is no path extension.

See also CFURLCopyLastPathComponent(_:).

See Also

Accessing the Parts of a URL