mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-10 15:52:27 +08:00
doc: update doc for v2.3.6
This commit is contained in:
@@ -182,7 +182,7 @@ func IsJSON(str string) bool {
|
||||
return json.Unmarshal([]byte(str), &js) == nil
|
||||
}
|
||||
|
||||
// IsAlphaNumericStr check if the string is alphanumeric.
|
||||
// IsAlphaNumeric check if the string is alphanumeric.
|
||||
// Play: todo
|
||||
func IsAlphaNumeric(s string) bool {
|
||||
return alphaNumericMatcher.MatchString(s)
|
||||
|
||||
@@ -665,3 +665,21 @@ func ExampleIsChinaUnionPay() {
|
||||
// true
|
||||
// false
|
||||
}
|
||||
|
||||
func ExampleIsAlphaNumeric() {
|
||||
result1 := IsAlphaNumeric("ABC")
|
||||
result2 := IsAlphaNumeric("123")
|
||||
result3 := IsAlphaNumeric("abc123")
|
||||
result4 := IsAlphaNumeric("abc123@#$")
|
||||
|
||||
fmt.Println(result1)
|
||||
fmt.Println(result2)
|
||||
fmt.Println(result3)
|
||||
fmt.Println(result4)
|
||||
|
||||
// Output:
|
||||
// true
|
||||
// true
|
||||
// true
|
||||
// false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user