diff --git a/vlib/encoding/utf8/utf8_util.v b/vlib/encoding/utf8/utf8_util.v index a9329ff511..d95db92dc2 100644 --- a/vlib/encoding/utf8/utf8_util.v +++ b/vlib/encoding/utf8/utf8_util.v @@ -113,13 +113,13 @@ pub fn raw_index(s string, index int) string { // reverse - returns a reversed string. // example: utf8.reverse('你好世界hello world') => 'dlrow olleh界世好你'. pub fn reverse(s string) string { - len_s := utf8.len(s) + len_s := len(s) if len_s == 0 || len_s == 1 { return s.clone() } mut str_array := []string{} - for i in 0..len_s { - str_array << utf8.raw_index(s, i) + for i in 0 .. len_s { + str_array << raw_index(s, i) } str_array = str_array.reverse() return str_array.join('')