Skip to content

Commit

Permalink
修改
Browse files Browse the repository at this point in the history
  • Loading branch information
qiang committed Feb 23, 2019
1 parent 9ea3931 commit 0dc161e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion zh/2.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,17 @@ value: jerry

说明:

reflect.TypeOf:获取参数的type类型,如float64、int、各种pointer、struct 等类型
reflect.TypeOf:获取参数的type类型,如float64、int、各种pointer、struct 等类型,如果判断变量的类型是否是某种类型

示例:

```
if reflect.TypeOf(v).String()=="string" {
}
```

v是变量

reflect.ValueOf:获取参数的值。

Expand Down
3 changes: 2 additions & 1 deletion zh/3.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ func main() {
// 的起始索引和结束索引,而不是匹配的字符串
fmt.Println(r.FindStringIndex("Hello World! world")) //[0 12]
// 这个方法返回全局匹配的字符串和局部匹配的字符,比如
// 这个方法返回全局匹配的字符串和局部匹配的字符,匹配最大的子字符串一次。
// 它和r.FindAllStringSubmatch("Hello World! world",1) 等价。 比如
// 这里会返回匹配`H(.*)d!`的字符串
// 和匹配`(.*)`的字符串
fmt.Println(r.FindStringSubmatch("Hello World! world")) //[Hello World! ello Worl]
Expand Down

0 comments on commit 0dc161e

Please sign in to comment.