大话2免费版一级星盘炼化表

    1. <form id=zhudObCNh><nobr id=zhudObCNh></nobr></form>
      <address id=zhudObCNh><nobr id=zhudObCNh><nobr id=zhudObCNh></nobr></nobr></address>

      Delete an element in slice using append in GoLang

      翻譯:
      呂滔博客


      Array [a b c]

      Task: Delete the second element. Get [a c] .

      Steps:


      package main
      import (
          "fmt"
      )
      //function used to delete the element
      func remove(s []string, i int) []string {
          return append(s[:i], s[i+1:]...)
      }
      func main() {
          s := []string{"a", "b", "c"}
          fmt.Println(s)
          s = remove(s, 1)
          fmt.Println(s)
      }

      國際版
      HoME大话2免费版一级星盘炼化表