IndexFunc
package main import ( "fmt" "strings" ) func main() { fmt.Printf("%d\n", strings.IndexFunc("study golang", func(r rune) bool { if r > 'u' { return true } return false })) }