Introduction to Strings Programming Guide for Core Foundation

Explains how to create, manipulate, and search strings in Core Foundation, and how strings interact with encodings and character sets.

Organization of This Document

This document contains the following articles:

About Strings describes issues related to managing and representing string

The Unicode Basis of CFString Objects describes the conceptual basis for the representation of strings in Core Foundation

String Storage describes how string data is stored in Core Foundation

Creating and Copying Strings describes how to create and copy string objects

Accessing the Contents of String Objects describes how to access the contents of CFString objects as a C or Unicode string, and how to iterate over the contents of a string one character at a time

Comparing, Sorting, and Searching String Objects describes how to search the contents of a string and how to compare two strings

Manipulating Mutable String Objects describes operations such as combining strings and padding the contents of a string.

Converting Between String Encodings describes how to convert between different string encodings, and what encodings are supported by CFString

Handling External Representations of Strings describes how to represent a string in a form that can be written to disk and read back in on the same platform or on a different platform

Creating and Using Ranges describes how to create and use CFRange structures

Character Sets describes the basics of CFCharacterSet

String Format Specifiers describes printf -style format specifiers supported by CFString

Not all functions are described. Some of the functions not discussed in detail are:

CFStringGetLength lets you obtain the number of Unicode characters represented by a CFString object.

CFStringGetLineBounds tells you how many lines a string (or a range of the string) spans.

CFStringCreateByCombiningStrings creates a single string from an array ( CFArray ) of strings; the counterpart of this function, CFStringCreateArrayBySeparatingStrings , creates a CFArray object from a single string, using a delimiter character to separate the substrings.

CFStringGetIntValue and CFStringGetDoubleValue convert a CFString object representing a number to the actual numeric value.

Next

Copyright © 2003, 2014 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2014-02-11