GO语言"strings"包中"ToTitle"函数的用法及代码示例。
用法:
func ToTitle(s string) string
ToTitle 返回字符串 s 的副本,其中所有 Unicode 字母都映射到它们的 Unicode 标题大小写。
例子:
package main
import (
"fmt"
"strings"
)
func main() {
// Compare this example to the Title example.
fmt.Println(strings.ToTitle("her royal highness"))
fmt.Println(strings.ToTitle("loud noises"))
fmt.Println(strings.ToTitle("хлеб"))
}
输出:
HER ROYAL HIGHNESS LOUD NOISES ХЛЕБ
相关用法
- GO ToTitle用法及代码示例
- GO ToTitleSpecial用法及代码示例
- GO ToLowerSpecial用法及代码示例
- GO ToUpper用法及代码示例
- GO To用法及代码示例
- GO ToUpperSpecial用法及代码示例
- GO ToLower用法及代码示例
- GO Time.Sub用法及代码示例
- GO TrailingZeros8用法及代码示例
- GO Tx.ExecContext用法及代码示例
- GO Template用法及代码示例
- GO Time.Equal用法及代码示例
- GO Time.After用法及代码示例
- GO Title用法及代码示例
- GO TrimRight用法及代码示例
- GO TempFile用法及代码示例
- GO Time.Format用法及代码示例
- GO Trunc用法及代码示例
- GO TrailingZeros32用法及代码示例
- GO Time.AppendFormat用法及代码示例
注:本文由纯净天空筛选整理自golang.google.cn大神的英文原创作品 ToTitle。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。