copy function that returns a value!

 

 

 

With copy () function to delete the beginning of the element:

  1. a = []int{1, 2, 3}
  2. a = a [: copy (a, a [1:])] // delete the beginning of an element
  3. a = a [: copy (a, a [N:])] // delete the beginning of the N elements

 

!!!!

 

 

 

 

Guess you like

Origin www.cnblogs.com/qiaoyanlin/p/12005343.html
Recommended