strings

package
v2.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLower

func IsLower(s string) bool
Example
fmt.Println(IsLower("中文a1"))
fmt.Println(IsLower("中文A1"))
Output:

true
false

func IsLowerU

func IsLowerU(s string) bool
Example
fmt.Println(IsLowerU("a1"))
fmt.Println(IsLowerU("中文a1")) // be careful!
fmt.Println(IsLowerU("中文A1"))
Output:

true
false
false

func IsUpper

func IsUpper(s string) bool
Example
fmt.Println(IsUpper("中文A1"))
fmt.Println(IsUpper("中文a1"))
Output:

true
false

func IsUpperU

func IsUpperU(s string) bool

IsUpperU 此方法的缺點,當遇到2字節的字母時可能會不如預期

Example

建議您檢驗的對象為Latin1的字集在使用此判斷,不然可能會不如您預期

fmt.Println(IsUpperU("ABC123"))
fmt.Println(IsUpperU("中文A1")) // be careful!
fmt.Println(IsUpperU("中文a1"))
Output:

true
false
false

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL