Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more
Module

x/simple_utility/mod.ts>accurateSegment

Useful snippet collection.
Go to Latest
function accurateSegment
import { accurateSegment } from "https://deno.land/x/simple_utility@v0.5.4/mod.ts";

Accurately recognize string that contain character above 0x010000 and array them one by character. Useful for calculate number of characters with string contains emoji.

Examples

Example 1

const text = "πŸ˜€πŸ˜ƒπŸ˜„πŸ˜πŸ˜†πŸ˜…πŸ˜‚πŸ€£";
const characters = accurateSegment(text);

Parameters

data: string

Returns

string[]