First returns first n characters from provided input. It removes all spaces in string before doing so.
(length int)
| 179 | |
| 180 | // First returns first n characters from provided input. It removes all spaces in string before doing so. |
| 181 | func (i *input) First(length int) string { |
| 182 | input := getInput(*i) |
| 183 | input = strings.ReplaceAll(input, " ", "") |
| 184 | if len(input) < length { |
| 185 | panic(errors.New(LengthError)) |
| 186 | } |
| 187 | return input[0:length] |
| 188 | } |
| 189 | |
| 190 | // Get simply returns result and can be chained on function which |
| 191 | // returns StringManipulation interface |
nothing calls this directly
no test coverage detected