mirror of https://github.com/gobeam/stringy.git
fix lcFirst leading multi-byte character bug
This commit is contained in:
parent
2e5ad8d58b
commit
571d4cc48e
|
@ -180,10 +180,10 @@ func (i *input) Last(length int) string {
|
||||||
// function which return StringManipulation interface
|
// function which return StringManipulation interface
|
||||||
func (i *input) LcFirst() string {
|
func (i *input) LcFirst() string {
|
||||||
input := getInput(*i)
|
input := getInput(*i)
|
||||||
for i, v := range input {
|
for _, v := range input {
|
||||||
return string(unicode.ToLower(v)) + input[i+1:]
|
return string(unicode.ToLower(v)) + input[len(string(v)):]
|
||||||
}
|
}
|
||||||
return input
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lines returns slice of strings by removing white space characters
|
// Lines returns slice of strings by removing white space characters
|
||||||
|
|
Loading…
Reference in New Issue