1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-08 14:42:27 +08:00

feat: add ContainNumber for validator (#97)

Co-authored-by: sunyaoyao <sunyaoyao@kezaihui.com>
This commit is contained in:
will
2023-05-19 11:23:19 +08:00
committed by GitHub
parent 3beb769f09
commit 78aa679670
3 changed files with 42 additions and 0 deletions

View File

@@ -36,6 +36,24 @@ func ExampleContainLetter() {
// true
}
func ExampleContainNumber() {
result1 := ContainNumber("你好")
result2 := ContainNumber("&@#$%^&*")
result3 := ContainNumber("ab1")
result4 := ContainNumber("1234")
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
fmt.Println(result4)
// Output:
// false
// false
// true
// true
}
func ExampleContainLower() {
result1 := ContainLower("abc")
result2 := ContainLower("aBC")