runesIndex is the equivalent of strings.Index for rune slices.
(r1, r2 []rune)
| 84 | |
| 85 | // runesIndex is the equivalent of strings.Index for rune slices. |
| 86 | func runesIndex(r1, r2 []rune) int { |
| 87 | last := len(r1) - len(r2) |
| 88 | for i := 0; i <= last; i++ { |
| 89 | if runesEqual(r1[i:i+len(r2)], r2) { |
| 90 | return i |
| 91 | } |
| 92 | } |
| 93 | return -1 |
| 94 | } |
| 95 | |
| 96 | func intArrayToString(ns []index) string { |
| 97 | if len(ns) == 0 { |
no test coverage detected