GetWord Function that returns word found in text 't' at position range 'begin' to 'end'.
(begin, end int, t string)
| 47 | |
| 48 | // GetWord Function that returns word found in text 't' at position range 'begin' to 'end'. |
| 49 | func GetWord(begin, end int, t string) string { |
| 50 | for end >= len(t) { |
| 51 | return "" |
| 52 | } |
| 53 | d := make([]uint8, end-begin+1) |
| 54 | for j, i := 0, begin; i <= end; i, j = i+1, j+1 { |
| 55 | d[j] = t[i] |
| 56 | } |
| 57 | return string(d) |
| 58 | } |
| 59 | |
| 60 | // ComputeAlphabet Function that returns string of all the possible characters in given patterns. |
| 61 | func ComputeAlphabet(p []string) (s string) { |
no outgoing calls
no test coverage detected