...
1
2
3
4
5 package cases_test
6
7 import (
8 "fmt"
9
10 "golang.org/x/text/cases"
11 "golang.org/x/text/language"
12 )
13
14 func Example() {
15 src := []string{
16 "hello world!",
17 "i with dot",
18 "'n ijsberg",
19 "here comes O'Brian",
20 }
21 for _, c := range []cases.Caser{
22 cases.Lower(language.Und),
23 cases.Upper(language.Turkish),
24 cases.Title(language.Dutch),
25 cases.Title(language.Und, cases.NoLower),
26 } {
27 fmt.Println()
28 for _, s := range src {
29 fmt.Println(c.String(s))
30 }
31 }
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 }
54
View as plain text