Golang copy()函数
生活随笔
收集整理的這篇文章主要介紹了
Golang copy()函数
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
copy是內置函數,用于從切片中復制數據(存在一種特殊情況即從字符串中復制到字符切片中),
源切片和目的切片可以重疊,返回復制的元素個數,等于源和目的的最小長度值。func copy(dst, src []Type) intThe copy built-in function copies elements from a source slice into a
destination slice. (As a special case, it also will copy bytes from a
string to a slice of bytes.) The source and destination may overlap.
Copy returns the number of elements copied, which will be the minimum
of len(src) and len(dst).
參考文檔:
1.?https://golang.org/pkg/builtin/#copy
總結
以上是生活随笔為你收集整理的Golang copy()函数的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: vsftpd Problem with
- 下一篇: win10怎么从u盘启动不 win10如