Last returns last n characters from provided input. It removes all spaces in string before doing so.
(length int)
| 208 | |
| 209 | // Last returns last n characters from provided input. It removes all spaces in string before doing so. |
| 210 | func (i *input) Last(length int) string { |
| 211 | input := getInput(*i) |
| 212 | input = strings.ReplaceAll(input, " ", "") |
| 213 | inputLen := len(input) |
| 214 | if len(input) < length { |
| 215 | panic(errors.New(LengthError)) |
| 216 | } |
| 217 | start := inputLen - length |
| 218 | return input[start:inputLen] |
| 219 | } |
| 220 | |
| 221 | // LcFirst simply returns result by lower casing first letter of string and it can be chained on |
| 222 | // function which return StringManipulation interface |
nothing calls this directly
no test coverage detected