12 lines
173 B
Go
12 lines
173 B
Go
package basic
|
|
|
|
func stripNonASCII(s string) string {
|
|
rs := make([]rune, 0, len(s))
|
|
for _, r := range s {
|
|
if r <= 127 {
|
|
rs = append(rs, r)
|
|
}
|
|
}
|
|
return string(rs)
|
|
}
|