Reverse reverses the passed strings it can be chained on function which return StringManipulation interface
()
| 301 | // Reverse reverses the passed strings |
| 302 | // it can be chained on function which return StringManipulation interface |
| 303 | func (i *input) Reverse() string { |
| 304 | input := getInput(*i) |
| 305 | r := []rune(input) |
| 306 | for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 { |
| 307 | r[i], r[j] = r[j], r[i] |
| 308 | } |
| 309 | return string(r) |
| 310 | } |
| 311 | |
| 312 | // Shuffle shuffles the given string randomly |
| 313 | // it can be chained on function which return StringManipulation interface |
nothing calls this directly
no test coverage detected