##啊哦,亲,你看得也太快了。。。还没翻译完呢 0 0 要不等到 ***2013 年 6 月 12 日*** 再来看看吧~~ 这里还有一些其它的学习资源噢~ - [《Go编程基础》](https://github.com/Unknwon/go-fundamental-programming):已更新至 [第10课](https://github.com/Unknwon/go-fundamental-programming/blob/master/lecture10/lecture10.md) - [《Go Web编程》](https://github.com/astaxie/build-web-application-with-golang) 神马?你说你不想学习?那好吧,去逛逛看看行情也行~ - [Go Walker](http://gowalker.org) **Go 项目文档在线浏览工具** - [Golang中文社区](http://bbs.mygolang.com/forum.php) - [Go语言学习园地](http://studygolang.com/) - [Golang中国](http://golang.tc) #strings 和 strconv 包 作为一种基本数据结构,每种语言都有一些对于字符串的预定义处理函数。Go 中使用 `strings` 包来完成对字符串的主要操作。 ##4.7.1 前缀和后缀 `HasPrefix` 判断字符串 `s` 是否以 `prefix` 开头: strings.HasPrefix(s, prefix string) bool `HasSuffix` 判断字符串 `s` 是否以 `suffix` 结尾: strings.HasSuffix(s, suffix string) bool Example 4.13 [presuffix.go](examples/chapter_4/presuffix.go) package main import ( “fmt” “strings” ) func main() { var str string = “This is an example of a string” fmt.Printf(“T/F? Does the string \”%s\” have prefix %s? “, str, “Th”) fmt.Printf(“%t\n”, strings.HasPrefix(str, “Th”)) } 输出: T/F? Does the string “This is an example of a string” have prefix Th? True 这个例子同样演示了转移字符 `\` 和格式化字符串的使用。 ##4.7.2 字符串包含关系 ##链接 - [目录](directory.md) - 上一节:[字符串](04.6.md) - 下一节:[时间和日期](04.8.md)