Contact: aviboots(AT)netvision.net.il
41,160 questions
53,652 answers
573 users
package main import ( "bytes" "fmt" ) func main() { slice := []byte("go java c++") i := bytes.Index(slice, []byte("java")) fmt.Println(i) } /* run: 3 */
package main import ( "bytes" "fmt" ) func main() { slice := []byte("go java c++") i := bytes.Index(slice, []byte("php")) fmt.Println(i) } /* run: -1 */