Repository navigation
Introduction to String Programming Guide for Cocoa
binism edited this page Mar 8, 2016
·
34 revisions
Cocoa字符串编程指南将介绍如何创建、搜索、拼接和绘制字符串。它还将介绍character set(字符集?)和scanner。character set能从一组字符中找到你需要的字符串,而scanner能够将数字转换成字符串,也能将字符串转换为相应数字。
如果在编程时需要直接使用string(字符串)、character set(字符集),你应该阅读本文档。
此文档包含以下文章:
- Strings 介绍了cocoa中string(字符串)对象的特性。
- Creating and Converting String Objects 介绍了支持多种字符编码的类NSString 和它的子类 NSMutableString如何创建string对象并将string对象的内容在各编码间相互转换。???
- Formatting String Objects 介绍了如何去格式化NSString对象。
- String Format Specifiers 介绍了类NSString所支持的字符串格式化输出(printf)的标识符。
- Reading Strings From and Writing Strings To Files and URLs 介绍了如何从文件和URL(统一资源定位器)中读取字符串、将字符串写入文件和URL(统一资源定位器)中。
- Searching, Comparing, and Sorting Strings介绍了在字符串中查找字符和子串和比较两个字符串的方法。
- Words, Paragraphs, and Line Breaks 介绍了单词、段落、行的定义方式。?
- [Characters and Grapheme Clusters] 介绍了如何把字符串分解为用户实际感知和使用的字符最小单元。
注:NSString和Unicode string在多数情况下,最小的字符单元不是单独的一个字母,而是包含多个字母的子串。
- Introduction
- Strings
- Creating and Converting String Objects
- Formatting String Objects
- String Format Specifiers
- Reading Strings From and Writing Strings To Files and URLs
- Searching, Comparing, and Sorting Strings
- Words, Paragraphs, and Line Breaks
- Characters and Grapheme Clusters
- Character Sets
- Scanners
- String Representations of File Paths
- Drawing Strings
- Document Revision History
- Index