Answers for "go Length of the array in Go"

Go
3

how to get the length of an array in go

array:=[]int {1,2,3,4}
len(array)
Posted by: Guest on September-23-2020
0

go Length of the array in Go

package main

import "fmt"

func main() {
    data := [...]string{"Ned", "Edd", "Jon", "Jeor", "Jorah"}
    fmt.Println("length of data is", len(data))
}
Posted by: Guest on October-18-2021

Browse Popular Code Answers by Language