2881| 3
|
[已解决]在go语言中,如何从一个[]byte切片提取json串放入[]byte切片中 |
10鱼币
最佳答案用一个简单粗暴的方法
package main
import (
"fmt"
"strings"
)
func main() {
b := []byte(`{"FileName":"1.txt","ID":"121","IPAdress":"1.1.1.2","ModifyTime":"8:27 2019/9/12","OrgName":"org2"},{"FileName":"2.txt","ID":"121","IPAdress":"1.1.1.2","ModifyTime":"18:06 2020/11/06","OrgName":"org2"}`)
s := strings.Split(string(b), "},")
b1 := []byte(s[0])
b2 := []byte(s[1])
fmt.Printl ...
| ||
小甲鱼最新课程 -> https://ilovefishc.com
|
||
| ||
小甲鱼最新课程 -> https://ilovefishc.com
|
||
| ||
小甲鱼最新课程 -> https://ilovefishc.com
|
||
| ||
小甲鱼最新课程 -> https://ilovefishc.com
|
||
小黑屋|手机版|Archiver|鱼C工作室
( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)
GMT+8, 2025-6-29 10:03
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.