Skip to content

Commit

Permalink
fix lcFirst leading multi-byte character bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcarmody committed Nov 6, 2021
1 parent 2e5ad8d commit 571d4cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stringy.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ func (i *input) Last(length int) string {
// function which return StringManipulation interface
func (i *input) LcFirst() string {
input := getInput(*i)
for i, v := range input {
return string(unicode.ToLower(v)) + input[i+1:]
for _, v := range input {
return string(unicode.ToLower(v)) + input[len(string(v)):]
}
return input
return ""
}

// Lines returns slice of strings by removing white space characters
Expand Down

0 comments on commit 571d4cc

Please sign in to comment.