Golang strings.ToLowerSpecial() 函数及示例

Golang strings.ToLowerSpecial() 函数及示例

strings.ToLowerSpecial() 函数 在 Golang 中用于返回字符串 s 的副本,其中所有 Unicode 字母都使用由 c 指定的大小写映射映射到它们的小写形式。

语法:

func ToLowerSpecial(c unicode.SpecialCase, s string) string

在此,c 是大小写映射,s 是指定的字符串。

示例 1:

// Golang 程序,演示
// strings.ToLowerSpecial 函数
package main
  
import (
    "fmt"
    "strings"
    "unicode"
)
  
func main() {
  
    // 使用该函数
    fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "Hello, Geeks"))
} 

输出:

hello, geeks

示例 2:

// Golang 程序,演示
// strings.ToLowerSpecial 函数
package main
  
import (
    "fmt"
    "strings"
    "unicode"
)
  
func main() {
  
    // 使用该函数
    fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "Computer Portal"))
} 

输出:

computer portal

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程