Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/simple_utility/src/text.ts

Useful snippet collection.
Go to Latest
import * as simpleUtility from "https://deno.land/x/simple_utility@v1.4.4/src/text.ts";

Functions

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

Clean up text with fixWidth() and trimExtend().

Convert half-width Japanese kana to full-width and full-width alphanumeric symbols to half-width.

Convert from hex string to binary.

Convert from binary to hex string.

Create string with zero padding at beginning of number. Output is 2 digits by default.

Trim head and tail blank, remove CR and consecutive space (tab, LF) to single space (tab, LF).

Convert from UTF-8 binary to string.

Convert from string to UTF-8 binary.