Browse Source

deleted: 18.6.md

songleo 10 years ago
parent
commit
f28c409d54
11 changed files with 60 additions and 67 deletions
  1. 60 60
      eBook/18.1.md
  2. 0 0
      eBook/18.10.md
  3. 0 0
      eBook/18.11.md
  4. 0 7
      eBook/18.2.md
  5. 0 0
      eBook/18.3.md
  6. 0 0
      eBook/18.4.md
  7. 0 0
      eBook/18.5.md
  8. 0 0
      eBook/18.6.md
  9. 0 0
      eBook/18.7.md
  10. 0 0
      eBook/18.8.md
  11. 0 0
      eBook/18.9.md

+ 60 - 60
eBook/18.1.md

@@ -1,61 +1,61 @@
-# 18.1 字符串
-
-(1)如何修改字符串中的一个字符:
-
-```go
-str:="hello"
-c:=[]byte(s)
-c[0]='c'
-s2:= string(c) // s2 == "cello"
-```
-
-(2)如何获取字符串的子串:
-
-```go
-substr := str[n:m]
-```
-
-(3)如何使用for或者for-range遍历一个字符串:
-
-```go
-// gives only the bytes:
-for i:=0; i < len(str); i++ {
-… = str[i]
-}
-// gives the Unicode characters:
-for ix, ch := range str {
-…
-}
-```
-
-(4)如何获取一个字符串的字节数:`len(str)`
-
-    如何获取一个字符串的字符数:
-
-    最快速:`utf8.RuneCountInString(str)`
-    
-    `len([]int(str)) //TBD`
-
-(5)如何连接字符串:
-
-    最快速: `with a bytes.Buffer`(参考[章节7.2](07.2.md))
-
-    `Strings.Join()`(参考[章节4.7](04.7.md))
-    
-    `+=`
-
-    ```go
-    str1 := "Hello " 
-    str2 := "World!"
-    str1 += str2 //str1 == "Hello World!"
-   ```
-
-(6)如何解析命令行参数:使用`os`或者`flag`包
-
-    (参考[例12.4](examples/chapter_12/fileinput.go))
-
-## 链接
-
-- [目录](directory.md)
-- 上一节:[出于性能考虑的实用代码片段](18.0.md)
+# 18.1 字符串
+
+(1)如何修改字符串中的一个字符:
+
+```go
+str:="hello"
+c:=[]byte(s)
+c[0]='c'
+s2:= string(c) // s2 == "cello"
+```
+
+(2)如何获取字符串的子串:
+
+```go
+substr := str[n:m]
+```
+
+(3)如何使用for或者for-range遍历一个字符串:
+
+```go
+// gives only the bytes:
+for i:=0; i < len(str); i++ {
+… = str[i]
+}
+// gives the Unicode characters:
+for ix, ch := range str {
+…
+}
+```
+
+(4)如何获取一个字符串的字节数:`len(str)`
+
+    如何获取一个字符串的字符数:
+
+    最快速:`utf8.RuneCountInString(str)`
+    
+    `len([]int(str)) //TBD`
+
+(5)如何连接字符串:
+
+    最快速: `with a bytes.Buffer`(参考[章节7.2](07.2.md))
+
+    `Strings.Join()`(参考[章节4.7](04.7.md))
+    
+    `+=`
+
+    ```go
+    str1 := "Hello " 
+    str2 := "World!"
+    str1 += str2 //str1 == "Hello World!"
+   ```
+
+(6)如何解析命令行参数:使用`os`或者`flag`包
+
+    (参考[例12.4](examples/chapter_12/fileinput.go))
+
+## 链接
+
+- [目录](directory.md)
+- 上一节:[出于性能考虑的实用代码片段](18.0.md)
 - 下一节:[数组和切片](18.2.md)

+ 0 - 0
eBook/18.10.md


+ 0 - 0
eBook/18.11.md


+ 0 - 7
eBook/18.2.md

@@ -1,7 +0,0 @@
-# 18 出于性能考虑的实用代码片段
-
-## 链接
-
-- [目录](directory.md)
-- 上一章:[运算符模板和接口](17.4.md)
-- 下一节:[字符串](18.1.md)

+ 0 - 0
eBook/18.3.md


+ 0 - 0
eBook/18.4.md


+ 0 - 0
eBook/18.5.md


+ 0 - 0
eBook/18.6.md


+ 0 - 0
eBook/18.7.md


+ 0 - 0
eBook/18.8.md


+ 0 - 0
eBook/18.9.md