Go 슬라이스 처음 n개 남기고 제거

(Go 슬라이스 처음 n개 원소 남기고 제거에서 넘어옴)

1 개요[ | ]

Go 슬라이스 처음 n개 남기기
Go 슬라이스 처음 n개 원소 남기기
Go 슬라이스 처음 원소 n개 남기기
package main

import "fmt"

func main() {
	students := []string{"A", "B", "C", "D", "E"}
	n := 3
	students = students[:n]
	fmt.Println(students) // [A B C]
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}