go

how to delete the Element in slice using Slice Golang

vinaygo

vinay

Posted on October 20, 2022

how to delete the Element in slice using Slice Golang
//how to delete the Number in Slice Golang
    a := []int{10, 20, 30, 40, 50, 60, 70, 80, 90}
    var i int
    fmt.Print("Enter deleted number index..: ")
    fmt.Scan(&i)
    a = append(a[:i], a[i+1:]...)
    fmt.Println(a)
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
vinaygo
vinay

Posted on October 20, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related