Time for an 2014 update…
This commit is contained in:
parent
372c577f83
commit
09687c4926
2520 changed files with 34227 additions and 7318 deletions
|
|
@ -10,16 +10,19 @@ import (
|
|||
func main() {
|
||||
show("alphaBETA")
|
||||
show("alpha BETA")
|
||||
show("DŽLjnj") // should render similar to DZLjnj
|
||||
// Three digraphs that should render similar to DZ, Lj, and nj.
|
||||
show("DŽLjnj")
|
||||
// Unicode apostrophe in third word.
|
||||
show("o'hare O'HARE o’hare don't")
|
||||
}
|
||||
|
||||
func show(s string) {
|
||||
fmt.Println("\nstring: ", s, "len:", utf8.RuneCountInString(s))
|
||||
fmt.Println("\nstring: ",
|
||||
s, " len:", utf8.RuneCountInString(s), "runes") // DZLjnj
|
||||
fmt.Println("All upper case: ", strings.ToUpper(s)) // DZLJNJ
|
||||
fmt.Println("All lower case: ", strings.ToLower(s)) // dzljnj
|
||||
fmt.Println("All title case: ", strings.ToTitle(s)) // DzLjNj
|
||||
// notice Title() only modifies first letters of words
|
||||
// non-first letters keep their case.
|
||||
fmt.Println("Title words: ", strings.Title(s)) // Dzljnj
|
||||
fmt.Println("Swapping case: ", strings.Map(unicode.SimpleFold, s))
|
||||
fmt.Println("Title words: ", strings.Title(s)) // Dzljnj
|
||||
fmt.Println("Swapping case: ", // DzLjNJ
|
||||
strings.Map(unicode.SimpleFold, s))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue