gitlab.com/evatix-go/core@v1.3.55/enums/stringcompareas/isAnyCharsFunc.go (about)

     1  package stringcompareas
     2  
     3  import "strings"
     4  
     5  // isAnyCharsFunc reports whether any Unicode
     6  // code points in chars are within contentLine.
     7  //
     8  // Tided with AnyChars
     9  var isAnyCharsFunc = func(
    10  	contentLine,
    11  	charsFind string,
    12  	isIgnoreCase bool,
    13  ) bool {
    14  	if isIgnoreCase {
    15  		return strings.ContainsAny(
    16  			strings.ToLower(contentLine),
    17  			strings.ToLower(charsFind),
    18  		)
    19  	}
    20  
    21  	return strings.ContainsAny(
    22  		contentLine,
    23  		charsFind,
    24  	)
    25  }