tss/exp/slice/main.go

15 lines
225 B
Go
Raw Normal View History

2022-05-02 23:23:56 -04:00
package main
import "fmt"
func main() {
var arr []int
for i := 0; i < 10; i++ {
arr = append(arr, i)
}
fmt.Println(arr)
fmt.Println(arr[:0], arr[0:])
fmt.Println(arr[:4], arr[4:])
fmt.Println(arr[:15], arr[15:])
}