Skip to main content
Go to Latest
method Buffer.byteLength
import { Buffer } from "https://deno.land/std@0.113.0/node/buffer.ts";

Returns the byte length of a string when encoded. This is not the same as String.prototype.length, which does not account for the encoding that is used to convert the string into bytes.

Parameters

string:
| string
| ArrayBufferView
| ArrayBuffer
| SharedArrayBuffer
optional
encoding = [UNSUPPORTED]

Returns

number