NimString extension

on

Methods

isHighSurrogate(int codeUnit) bool

Available on String, provided by the NimString extension

isLowSurrogate(int codeUnit) bool

Available on String, provided by the NimString extension

subStringWithMaxLength(int maxLen, {int startLen = 2, int endLen = 2, String ellipsis = '...'}) String

Available on String, provided by the NimString extension

根据最大字符限制截取字符串 例:xx...xx emoji表情按一个字符算,不截取
subStringWithoutEmoji(int start, [int? end]) String

Available on String, provided by the NimString extension

截取字符串,但是不截断emoji表情 emoji表情占两个字符,high+low