Contact: aviboots(AT)netvision.net.il
39,845 questions
51,766 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 */