MCPcopy Create free account
hub / github.com/cherish-chat/xxim-server / Utf8Split

Method Utf8Split

common/utils/string.go:23–38  ·  view source on GitHub ↗
(s string, length int)

Source from the content-addressed store, hash-verified

21}
22
23func (x *xString) Utf8Split(s string, length int) string {
24 if len(s) == 0 {
25 return ""
26 }
27 var result string
28 for i := 0; i < length; i++ {
29 first := x.FirstUtf8(s)
30 if first == "" {
31 break
32 }
33 result += first
34 //去掉第一个字符
35 s = s[len(first):]
36 }
37 return result
38}

Callers 2

Test_xString_Utf8SplitFunction · 0.95
GroupCreateMethod · 0.80

Calls 1

FirstUtf8Method · 0.95

Tested by 1

Test_xString_Utf8SplitFunction · 0.76