学的语言多了,难免会搞混,Go 在编写习惯上跟 Java 很像,在截取 string 时习惯用了 substring
,很显然不成功。
在截取字符串和数组上 Go 跟 Python 很像,直接用索引截取即可
1 | s[0:3] |
最近热读
扫码关注公众号,或搜索公众号“温欣爸比”
及时获取我的最新文章
