There are cases where you want the delimiter to be a space

I figure that if the user is just passing in a single " " then that would match that case. However it don't handle the case of multiple `"  "` being intentional -- I'm not sure how you would want to handle this.

Perhaps, if the change should be on 173?
This commit is contained in:
Arran Ubels 2024-12-11 13:15:54 +11:00 committed by GitHub
parent 3769c2b2bb
commit 09576ff387
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -169,7 +169,7 @@ func (i *input) ContainsAll(check ...string) bool {
// by default and you dont have to worry about it. // by default and you dont have to worry about it.
func (i *input) Delimited(delimiter string, rule ...string) StringManipulation { func (i *input) Delimited(delimiter string, rule ...string) StringManipulation {
input := getInput(*i) input := getInput(*i)
if strings.TrimSpace(delimiter) == "" { if strings.TrimSpace(delimiter) == "" && delimiter != " " {
delimiter = "." delimiter = "."
} }
wordArray := caseHelper(input, false, rule...) wordArray := caseHelper(input, false, rule...)