github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2014/taste/examples.go (about)

     1  // +build OMIT
     2  
     3  package examples
     4  
     5  // IndexOfAny START OMIT
     6  func IndexOfAny(str string, chars []rune) int {
     7  	if len(str) == 0 || len(chars) == 0 {
     8  		return -1
     9  	}
    10  	for i, ch := range str {
    11  		for _, match := range chars {
    12  			if ch == match {
    13  				return i
    14  			}
    15  		}
    16  	}
    17  	return -1
    18  }
    19  
    20  // IndexOfAny END OMIT