Open yiGmMk opened 2 years ago
https://www.programnotes.cn/go-string/
下标访问12345func TestStr(t *testing.T) { str := 中\a log.Println(unsafe.Sizeof(rune('中')), unsafe.Sizeof(str[0]), str[0], string(str[0]))}// 输出: 2022/09/15 19:55:27 4 1 228 ä range12345678con
中\a
https://www.programnotes.cn/go-string/
下标访问12345func TestStr(t *testing.T) { str :=
中\a
log.Println(unsafe.Sizeof(rune('中')), unsafe.Sizeof(str[0]), str[0], string(str[0]))}// 输出: 2022/09/15 19:55:27 4 1 228 ä range12345678con