Skip to content

扩展 utf8 提供根据字符数量确定字符串索引位置 #7

@thinkeridea

Description

@thinkeridea

使用 utf8.DecodeRuneInString 逐个解析字符,使得比把字符串转为 []rune 运行效率更高,但是这并不是最好的解决方案,我需要一个方法在字符串中计算指定数量字符的索引位置,使得可以高效的利用字符串切片获得高效处理多字节字符的方案。

灵感来自 #5

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions