OxL Reference

fn bytesOf

The UTF-8 bytes of a string: decode<T>(bytesOf(text), Format.Json).

Example:

oxl✓ checked in CI
use std.ser { bytesOf }

fn main() io {
  print("{bytesOf(&"abc").len()}")
}
Output
3
@intrinsic("ser.bytesOf") pub(api) fn bytesOf(s: &str) -> bytes

Since. 1.0.0-beta

Parameters

NameType
s&str

Returns

bytes

Effects

none declared (pure unless the body says otherwise)

Defined in: std/ser/ser.oxl:2321

See also