fix:split emoji and rare character #50

This commit is contained in:
黄云飞
2022-05-18 17:35:13 +08:00
parent 84209b719c
commit 7c37e84497
6 changed files with 25 additions and 16 deletions
+8
View File
@@ -51,4 +51,12 @@ export function getUUID(): string {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
}
return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
}
export function splitText(text: string): string[] {
const data: string[] = []
for (const t of text) {
data.push(t)
}
return data
}