duanliang8464
2017-07-25 03:36
浏览 671
已采纳

如何在GO中将二维数组转换为一维数组?

Here are two data structures

result []byte
chunk  [][]byte

"chunk" is initialized as follows

chunk := make([][]byte, 3)
for i := 0 ; i < 5; i++ {
      chunk[i] = data //data is a byte array
}

How can I concatenate chunks into to result[]?

Example

If chunks is "123", "456", "789", then result should be "123456789"

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题