Golang 与 JS 的字符串截取大同小异

通过llama.cpp与羊驼聊天的网页界面- 详解 Serge 的启动使用

 

Golang 和 JS 的字符串截取都可以利用索引定位的方式。

 

Golang:

str := "abcdef"

sub := str[1: 2]

 

JS:

const str = 'abcdef'

const sub = str.substring(1, 2)

 

Link:https://www.cnblogs.com/farwish/p/13400119.html

posted on 2020-07-29 22:41  ercom  阅读(266)  评论(0编辑  收藏  举报