mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 03:55:28 +08:00
7.6.2
This commit is contained in:
@@ -37,6 +37,10 @@ b = append(b, s...)
|
||||
|
||||
# 7.6.2 获取字符串的某一部分
|
||||
|
||||
使用 `substr := str[start:end]` 可以从字符串 str 获取到从索引 start 开始到 end-1 位置的子字符串。同样的,`str[start:]` 则表示获取从 start 开始到 len(str)-1 位置的子字符串。而 `str[:end]` 表示获取从 0 开始到 end-1 的子字符串。
|
||||
|
||||
# 7.6.3 字符串和切片的内存结构
|
||||
|
||||
|
||||
|
||||
179
|
||||
|
Reference in New Issue
Block a user