fix lcFirst leading multi-byte character bug

This commit is contained in:
Matt 2021-11-06 00:59:33 -04:00
parent 2e5ad8d58b
commit 571d4cc48e
1 changed files with 3 additions and 3 deletions

View File

@ -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