Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/simple_utility/mod.ts>textSplitBySegment

Simplify processing for Deno.
Go to Latest
function textSplitBySegment
import { textSplitBySegment } from "https://deno.land/x/simple_utility@v2.2.1/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 emojis = textSplitBySegment("πŸ˜€πŸ˜ƒπŸ˜„πŸ˜πŸ˜†πŸ˜…πŸ˜‚πŸ€£");

Parameters

data: string

Returns

string[]