==strings.Compare

如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package main

import (
	"fmt"
	"strings"
)

func main(){
	fmt.Println(strings.Compare("golang","GoLang"))
	fmt.Println(strings.Compare("GoLang","golang"))
	fmt.Println(strings.Compare("golang","golang"))

	fmt.Println(strings.EqualFold("GoLang","golang"))
	fmt.Println(strings.EqualFold("golang","GoLang"))
}

输出:

1
2
3
4
5
1
-1
0
true
true
strings.Compare

strings.Compare

strings.EqualFold

strings.EqualFold

本文网址: https://golangnote.com/topic/250.html 转摘请注明来源