RemoveSpecialCharacter removes all special characters and returns the string it can be chained on function which return StringManipulation interface
()
| 267 | // RemoveSpecialCharacter removes all special characters and returns the string |
| 268 | // it can be chained on function which return StringManipulation interface |
| 269 | func (i *input) RemoveSpecialCharacter() string { |
| 270 | input := getInput(*i) |
| 271 | var result strings.Builder |
| 272 | for i := 0; i < len(input); i++ { |
| 273 | b := input[i] |
| 274 | if ('a' <= b && b <= 'z') || |
| 275 | ('A' <= b && b <= 'Z') || |
| 276 | ('0' <= b && b <= '9') || |
| 277 | b == ' ' { |
| 278 | result.WriteByte(b) |
| 279 | } |
| 280 | } |
| 281 | return result.String() |
| 282 | } |
| 283 | |
| 284 | // ReplaceFirst takes two param search and replace. It returns string by searching search |
| 285 | // sub string and replacing it with replace substring on first occurrence it can be chained |
nothing calls this directly
no test coverage detected