iOS 基础类解析 - NSString
2015-10-30 08:57
501 查看
时间 2014-05-01 07:41:20 CSDN博客
原文 http://blog.csdn.net/opengl_es/article/details/24829203
主题 iOS开发
创建和初始化字符串
从一个文件创建和初始化字符串
Creating and Initializing a String from a File
从一个 URL 创建和初始化字符串
Creating and Initializing a String from an URL
将字符串内容写到文件或 URL
获取字符串长度
获取字符和字节
获取 C 字符串
拼接字符串
拆分字符串
查找字符和子字符串
替换字符串
确定行和段落的范围
确定组成字符的顺序*
将字符串内容转换成属性列表
Converting String Contents Into a Property List
识别和比较字符串
拆叠字符串*
获取公共的前缀
改变大小写
使用映射获取多个字符串*
获取数字值
处理字符编码
处理路径
处理 URL
语言标记和分析*
原文 http://blog.csdn.net/opengl_es/article/details/24829203
主题 iOS开发
创建和初始化字符串
Creating and Initializing Strings
+ string
– init
– initWithBytes:length:encoding:
– initWithBytesNoCopy:length:encoding:freeWhenDone:
– initWithCharacters:length:
– initWithCharactersNoCopy:length:freeWhenDone:
– initWithString:
– initWithCString:encoding:
– initWithUTF8String:
– initWithFormat:
– initWithFormat:arguments:
– initWithFormat:locale:
– initWithFormat:locale:arguments:
– initWithData:encoding:
+ stringWithFormat:
+ localizedStringWithFormat:
+ stringWithCharacters:length:
+ stringWithString:
+ stringWithCString:encoding:
+ stringWithUTF8String:
+ stringWithCString:Deprecated in iOS 2.0
+ stringWithCString:length:Deprecated in iOS 2.0
– initWithCString:Deprecated in iOS 2.0
– initWithCString:length:Deprecated in iOS 2.0
– initWithCStringNoCopy:length:freeWhenDone:Deprecated in iOS 2.0
从一个文件创建和初始化字符串
Creating and Initializing a String from a File
+ stringWithContentsOfFile:encoding:error:
– initWithContentsOfFile:encoding:error:
+ stringWithContentsOfFile:usedEncoding:error:
– initWithContentsOfFile:usedEncoding:error:
+ stringWithContentsOfFile:Deprecated in iOS 2.0
– initWithContentsOfFile:Deprecated in iOS 2.0
从一个 URL 创建和初始化字符串
Creating and Initializing a String from an URL
+ stringWithContentsOfURL:encoding:error:
– initWithContentsOfURL:encoding:error:
+ stringWithContentsOfURL:usedEncoding:error:
– initWithContentsOfURL:usedEncoding:error:
+ stringWithContentsOfURL:Deprecated in iOS 2.0
– initWithContentsOfURL:Deprecated in iOS 2.0
将字符串内容写到文件或 URL
Writing to a File or URL
– writeToFile:atomically:encoding:error:
– writeToURL:atomically:encoding:error:
– writeToFile:atomically:Deprecated in iOS 2.0
– writeToURL:atomically:Deprecated in iOS 2.0
获取字符串长度
Getting a String’s Length
– length
– lengthOfBytesUsingEncoding:
– maximumLengthOfBytesUsingEncoding:
获取字符和字节
Getting Characters and Bytes
– characterAtIndex:
– getCharacters:range:
– getBytes:maxLength:usedLength:encoding:options:range:remainingRange:
– getCharacters:Deprecated in iOS 4.0
获取 C 字符串
Getting C Strings
– cStringUsingEncoding:
– getCString:maxLength:encoding:
– UTF8String
– cStringDeprecated in iOS 2.0
– cStringLengthDeprecated in iOS 2.0
– getCString:Deprecated in iOS 2.0
– getCString:maxLength:Deprecated in iOS 2.0
– getCString:maxLength:range:remainingRange:Deprecated in iOS 2.0
– lossyCStringDeprecated in iOS 2.0
拼接字符串
Combining Strings
– stringByAppendingFormat:
– stringByAppendingString:
– stringByPaddingToLength:withString:startingAtIndex:
拆分字符串
Dividing Strings
– componentsSeparatedByString:
– componentsSeparatedByCharactersInSet:
– stringByTrimmingCharactersInSet:
– substringFromIndex:
– substringWithRange:
– substringToIndex:
查找字符和子字符串
Finding Characters and Substrings
– rangeOfCharacterFromSet:
– rangeOfCharacterFromSet:options:
– rangeOfCharacterFromSet:options:range:
– rangeOfString:
– rangeOfString:options:
– rangeOfString:options:range:
– rangeOfString:options:range:locale:
– enumerateLinesUsingBlock:
– enumerateSubstringsInRange:options:usingBlock:
替换字符串
Replacing Substrings
– stringByReplacingOccurrencesOfString:withString:
– stringByReplacingOccurrencesOfString:withString:options:range:
– stringByReplacingCharactersInRange:withString:
确定行和段落的范围
Determining Line and Paragraph Ranges
– getLineStart:end:contentsEnd:forRange:
– lineRangeForRange:
– getParagraphStart:end:contentsEnd:forRange:
– paragraphRangeForRange:
确定组成字符的顺序*
Determining Composed Character Sequences
– rangeOfComposedCharacterSequenceAtIndex:
– rangeOfComposedCharacterSequencesForRange:
将字符串内容转换成属性列表
Converting String Contents Into a Property List
– propertyList
– propertyListFromStringsFileFormat
识别和比较字符串
Identifying and Comparing Strings
– caseInsensitiveCompare:
– localizedCaseInsensitiveCompare:
– compare:
– localizedCompare:
– compare:options:
– compare:options:range:
– compare:options:range:locale:
– localizedStandardCompare:
– hasPrefix:
– hasSuffix:
– isEqualToString:
– hash
拆叠字符串*
Folding Strings
– stringByFoldingWithOptions:locale:
获取公共的前缀
Getting a Shared Prefix
– commonPrefixWithString:options:
改变大小写
Changing Case
– capitalizedString
– capitalizedStringWithLocale:
– lowercaseString
– lowercaseStringWithLocale:
– uppercaseString
– uppercaseStringWithLocale:
使用映射获取多个字符串*
Getting Strings with Mapping
– decomposedStringWithCanonicalMapping
– decomposedStringWithCompatibilityMapping
– precomposedStringWithCanonicalMapping
– precomposedStringWithCompatibilityMapping
获取数字值
Getting Numeric Values
– doubleValue
– floatValue
– intValue
– integerValue
– longLongValue
– boolValue
处理字符编码
Working with Encodings
+ availableStringEncodings
+ defaultCStringEncoding
+ localizedNameOfStringEncoding:
– canBeConvertedToEncoding:
– dataUsingEncoding:
– dataUsingEncoding:allowLossyConversion:
– description
– fastestEncoding
– smallestEncoding
处理路径
Working with Paths
+ pathWithComponents:
– pathComponents
– completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:
– fileSystemRepresentation
– getFileSystemRepresentation:maxLength:
– isAbsolutePath
– lastPathComponent
– pathExtension
– stringByAbbreviatingWithTildeInPath
– stringByAppendingPathComponent:
– stringByAppendingPathExtension:
– stringByDeletingLastPathComponent
– stringByDeletingPathExtension
– stringByExpandingTildeInPath
– stringByResolvingSymlinksInPath
– stringByStandardizingPath
– stringsByAppendingPaths:
处理 URL
Working with URLs
– stringByAddingPercentEscapesUsingEncoding:
– stringByReplacingPercentEscapesUsingEncoding:
– stringByAddingPercentEncodingWithAllowedCharacters:
– stringByRemovingPercentEncoding
语言标记和分析*
Linguistic Tagging and Analysis
– enumerateLinguisticTagsInRange:scheme:options:orthography:usingBlock:
– linguisticTagsInRange:scheme:options:orthography:tokenRanges:
相关文章推荐
- iOS 第三方使用常规流程
- iOS 开发:上拉加载,下拉刷新
- iOS导航栏背景色,去掉边界黑线,去掉搜索框的边界黑线和其中文本输入框的阴影
- iOS反向传值demo--代理方法
- iOS反向传值-----系统单例方法
- iOS反向传值--Block方法
- iOS中属性与成员变量的区别
- ios推送消息的基本原理
- iOS 9 学习系列:Xcode Code Coverage Tools
- ios多台电脑,共用一个证书密密钥(最全整理)
- iOS开发见闻-第4期
- 1.7-nagios配置邮件告警
- 1.6-nagios监控客户端-2
- iOS开发之前言
- 我的iOS学习历程 - OC第四天
- 我的iOS学习历程 - OC第四天
- iOS 页面间传值 之 单例传值 , block 传值
- ios中block的循环引用
- iOS xml解析
- iOS(2)Block的使用