github.com/gogf/gf/v2@v2.7.4/text/gstr/gstr_contain.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package gstr
     8  
     9  import "strings"
    10  
    11  // Contains reports whether `substr` is within `str`, case-sensitively.
    12  func Contains(str, substr string) bool {
    13  	return strings.Contains(str, substr)
    14  }
    15  
    16  // ContainsI reports whether substr is within str, case-insensitively.
    17  func ContainsI(str, substr string) bool {
    18  	return PosI(str, substr) != -1
    19  }
    20  
    21  // ContainsAny reports whether any Unicode code points in `chars` are within `s`.
    22  func ContainsAny(s, chars string) bool {
    23  	return strings.ContainsAny(s, chars)
    24  }