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

x/ayonli_jsext/esm/string/index.js>byteLength

A JavaScript extension package for building strong and modern applications.
Latest
function byteLength
import { byteLength } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/string/index.js";

Returns the byte length of the string.

Examples

Example 1

import { byteLength } from "@ayonli/jsext/string";

console.log(byteLength("hello world")); // 11
console.log(byteLength("你好,世界!")); // 18