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

x/ayonli_jsext/string/index.ts>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/string/index.ts";

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

Parameters

str: string

Returns

number