示例#1
0
func ExampleSort() {
	slice := []string{"Aardvark", "hello", "aardvark", "  Hello", "World!"}
	normalizedsort.Sort(slice, nil)
	fmt.Printf("%q\n", slice)
	// Output: ["  Hello" "Aardvark" "aardvark" "hello" "World!"]
}
示例#2
0
func ExampleCaseInsensitiveTrimSpace() {
	slice := []string{"Aardvark", "hello", "aardvark", "  Hello", "World!"}
	normalizedsort.Sort(slice, normalizedsort.CaseInsensitiveTrimSpace)
	fmt.Printf("%q\n", slice)
	// Output: ["Aardvark" "aardvark" "  Hello" "hello" "World!"]
}