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

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

原文地址:https://www.cnblogs.com/farwish/p/13400119.html