2486| 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 ...
| ||
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
|
||
发表于 2020-11-6 19:30:18
|
显示全部楼层
本楼为最佳答案
| ||
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
|
||
| ||
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
|
||
| ||
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
|
||
小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)
GMT+8, 2025-1-17 23:06
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.