第六章:修复 strings_map.go 引用 (#848)

This commit is contained in:
Rethan
2022-06-21 07:39:09 +08:00
committed by GitHub
parent 36742d03bb
commit 8f1ca5772e

View File

@@ -48,7 +48,7 @@ type binOp func(a, b int) int
func run(op binOp, req *Request) { }
```
**练习 6.7** [strings_map.go](exercises\chapter_6\strings_map.go)
**练习 6.7** [strings_map.go](exercises/chapter_6/strings_map.go)
`strings` 中的 `Map()` 函数和 `strings.IndexFunc()` 一样都是非常好的使用例子。请学习它的源代码并基于该函数书写一个程序,要求将指定文本内的所有非 ASCII 字符替换成问号 `'?'` 或空格 `' '`。您需要怎么做才能删除这些字符呢?