chars
chars(
length,options?):string
Defined in: src/global/strings.ts:74
A random string of length code points, not UTF-16 units.
An astral character costs two UTF-16 units, so chars(10) can return a
string whose .length is more than ten. The count is of characters.
Parameters
Section titled “Parameters”length
Section titled “length”number
options?
Section titled “options?”Returns
Section titled “Returns”string
Example
Section titled “Example”chars(8, { blocks: "kana" }); // "へソむリあヴんケ"chars(5, { blocks: "emoji" }).length; // 10, five astral characters