Tokenizes a string into an array of tokens.
The string to tokenize.
If true, performs word-based tokenization. Default is false.
An array of tokens.
import { tokenize } from "@std/internal/diff-str";import { assertEquals } from "@std/assert";assertEquals(tokenize("Hello\nWorld"), ["Hello\n", "World"]); Copy
import { tokenize } from "@std/internal/diff-str";import { assertEquals } from "@std/assert";assertEquals(tokenize("Hello\nWorld"), ["Hello\n", "World"]);
Tokenizes a string into an array of tokens.