Files
the-way-to-go_ZH_CN/eBook/exercises/chapter_6/strings_map.go
2017-02-11 12:24:19 +08:00

20 lines
242 B
Go
Executable File

// strings_map.go
package main
import (
"fmt"
"strings"
)
func main() {
asciiOnly := func(c rune) rune {
if c > 127 {
return ' '
}
return c
}
fmt.Println(strings.Map(asciiOnly, "Jérôme Österreich"))
}
// J r me sterreich