Core Foundation string objects give software developers a solid foundation for easy, robust, and consistent internationalization. Moreover, by using string objects, your programs can easily share string data with any other Mac OS 9, Mac OS X, or other Cocoa program. String objects offer a full suite of fast and efficient string functionality, including utilities for converting among various encodings and buffer formats.
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 Pascal, 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.
© 2003, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-03-11)