NSString Class Reference
PDF
Overview
String Objects
Understanding characters
Interpreting UTF-16-encoded data
Distributed objects
Subclassing Notes
Methods to Override
Alternatives to Subclassing
Adopted Protocols
Tasks
Creating and Initializing Strings
Creating and Initializing a String from a File
Creating and Initializing a String from an URL
Writing to a File or URL
Getting a String’s Length
Getting Characters and Bytes
Getting C Strings
Combining Strings
Dividing Strings
Finding Characters and Substrings
Replacing Substrings
Determining Line and Paragraph Ranges
Determining Composed Character Sequences
Converting String Contents Into a Property List
Identifying and Comparing Strings
Folding Strings
Getting a Shared Prefix
Changing Case
Getting Strings with Mapping
Getting Numeric Values
Working with Encodings
Working with Paths
Working with URLs
Class Methods
availableStringEncodings
defaultCStringEncoding
localizedNameOfStringEncoding:
localizedStringWithFormat:
pathWithComponents:
string
stringWithCharacters:length:
stringWithContentsOfFile:encoding:error:
stringWithContentsOfFile:usedEncoding:error:
stringWithContentsOfURL:encoding:error:
stringWithContentsOfURL:usedEncoding:error:
stringWithCString:encoding:
stringWithFormat:
stringWithString:
stringWithUTF8String:
Instance Methods
boolValue
canBeConvertedToEncoding:
capitalizedString
caseInsensitiveCompare:
characterAtIndex:
commonPrefixWithString:options:
compare:
compare:options:
compare:options:range:
compare:options:range:locale:
completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:
componentsSeparatedByCharactersInSet:
componentsSeparatedByString:
cStringUsingEncoding:
dataUsingEncoding:
dataUsingEncoding:allowLossyConversion:
decomposedStringWithCanonicalMapping
decomposedStringWithCompatibilityMapping
description
doubleValue
fastestEncoding
fileSystemRepresentation
floatValue
getBytes:maxLength:usedLength:encoding:options:range:remainingRange:
getCharacters:
getCharacters:range:
getCString:maxLength:encoding:
getFileSystemRepresentation:maxLength:
getLineStart:end:contentsEnd:forRange:
getParagraphStart:end:contentsEnd:forRange:
hash
hasPrefix:
hasSuffix:
init
initWithBytes:length:encoding:
initWithBytesNoCopy:length:encoding:freeWhenDone:
initWithCharacters:length:
initWithCharactersNoCopy:length:freeWhenDone:
initWithContentsOfFile:encoding:error:
initWithContentsOfFile:usedEncoding:error:
initWithContentsOfURL:encoding:error:
initWithContentsOfURL:usedEncoding:error:
initWithCString:encoding:
initWithData:encoding:
initWithFormat:
initWithFormat:arguments:
initWithFormat:locale:
initWithFormat:locale:arguments:
initWithString:
initWithUTF8String:
integerValue
intValue
isAbsolutePath
isEqualToString:
lastPathComponent
length
lengthOfBytesUsingEncoding:
lineRangeForRange:
localizedCaseInsensitiveCompare:
localizedCompare:
longLongValue
lowercaseString
maximumLengthOfBytesUsingEncoding:
paragraphRangeForRange:
pathComponents
pathExtension
precomposedStringWithCanonicalMapping
precomposedStringWithCompatibilityMapping
propertyList
propertyListFromStringsFileFormat
rangeOfCharacterFromSet:
rangeOfCharacterFromSet:options:
rangeOfCharacterFromSet:options:range:
rangeOfComposedCharacterSequenceAtIndex:
rangeOfComposedCharacterSequencesForRange:
rangeOfString:
rangeOfString:options:
rangeOfString:options:range:
rangeOfString:options:range:locale:
smallestEncoding
stringByAbbreviatingWithTildeInPath
stringByAddingPercentEscapesUsingEncoding:
stringByAppendingFormat:
stringByAppendingPathComponent:
stringByAppendingPathExtension:
stringByAppendingString:
stringByDeletingLastPathComponent
stringByDeletingPathExtension
stringByExpandingTildeInPath
stringByFoldingWithOptions:locale:
stringByPaddingToLength:withString:startingAtIndex:
stringByReplacingCharactersInRange:withString:
stringByReplacingOccurrencesOfString:withString:
stringByReplacingOccurrencesOfString:withString:options:range:
stringByReplacingPercentEscapesUsingEncoding:
stringByResolvingSymlinksInPath
stringByStandardizingPath
stringByTrimmingCharactersInSet:
stringsByAppendingPaths:
substringFromIndex:
substringToIndex:
substringWithRange:
uppercaseString
UTF8String
writeToFile:atomically:encoding:error:
writeToURL:atomically:encoding:error:
Constants
unichar
NSMaximumStringLength
NSStringCompareOptions
Search and Comparison Options
NSStringEncodingConversionOptions
Encoding Conversion Options
NSString Handling Exception Names
NSStringEncoding
String Encodings
Appendix A: Deprecated NSString Methods
Deprecated in Mac OS X v10.4
stringWithContentsOfFile:
stringWithContentsOfURL:
stringWithCString:
stringWithCString:length:
cString
cStringLength
getCString:
getCString:maxLength:
getCString:maxLength:range:remainingRange:
initWithContentsOfFile:
initWithContentsOfURL:
initWithCString:
initWithCString:length:
initWithCStringNoCopy:length:freeWhenDone:
lossyCString
writeToFile:atomically:
writeToURL:atomically:
Revision History
Index
Companion Guides
String Programming Guide for Cocoa
Property List Programming Guide