(s string)
| 47 | } |
| 48 | |
| 49 | func CleanString(s string) string { |
| 50 | s = SafeString(s) |
| 51 | ss := "" |
| 52 | lastSpace := false |
| 53 | for _, r := range s { |
| 54 | if unicode.IsLetter(r) || unicode.IsNumber(r) { |
| 55 | ss += string(r) |
| 56 | lastSpace = false |
| 57 | } else { |
| 58 | if !lastSpace { |
| 59 | ss += " " |
| 60 | lastSpace = true |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | if lastSpace { |
| 65 | return ss[:len(ss)-1] |
| 66 | } |
| 67 | return ss |
| 68 | } |
| 69 | |
| 70 | func HasAllStrings(s string, strs []string) bool { |
| 71 | for _, ss := range strs { |
no test coverage detected