
成都创新互联公司主营衢州网站建设的网络公司,主营网站建设方案,app开发定制,衢州h5小程序定制开发搭建,衢州网站营销推广欢迎衢州等地区企业咨询
ToLower将s中所有Unicode字符都变为小写并返回其副本。 ToLower(s string) string
func ExampleToLower() {
var (
s = `GOFRAME`
result = gstr.ToLower(s)
)
fmt.Println(result)
// Output:
// GoFrame
}ToUpper将s中所有Unicode字符都变为大写并返回其副本。 ToUpper(s string) string
func ExampleToUpper() {
var (
s = `goframe`
result = gstr.ToUpper(s)
)
fmt.Println(result)
// Output:
// GOFRAME
}UcFirst将s中首字符变为大写并返回其副本。 UcFirst(s string) string
func ExampleUcFirst() {
var (
s = `hello`
result = gstr.UcFirst(s)
)
fmt.Println(result)
// Output:
// Hello
}LcFirst将s中首字符变为小写并返回其副本。 LcFirst(s string) string
func ExampleLcFirst() {
var (
str = `Goframe`
result = gstr.LcFirst(str)
)
fmt.Println(result)
// Output:
// goframe
}UcWords将字符串str中每个单词的第一个字符变为大写。 UcWords(str string) string
func ExampleUcWords() {
var (
str = `hello world`
result = gstr.UcWords(str)
)
fmt.Println(result)
// Output:
// Hello World
}IsLetterLower验证给定的字符b是否是小写字符。 IsLetterLower(b byte) bool
func ExampleIsLetterLower() {
fmt.Println(gstr.IsLetterLower('a'))
fmt.Println(gstr.IsLetterLower('A'))
// Output:
// true
// false
}IsLetterUpper验证字符b是否是大写字符。 IsLetterUpper(b byte) bool
func ExampleIsLetterUpper() {
fmt.Println(gstr.IsLetterUpper('A'))
fmt.Println(gstr.IsLetterUpper('a'))
// Output:
// true
// false
}