OxL Reference

fn textOf

The text of UTF-8 bytes: textOf(encode(x, Format.Json)).

Example:

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

fn main() io {
  print(textOf(&bytesOf(&"ok"))!)
}
Output
ok
@intrinsic("ser.textOf") pub(api) fn textOf(b: &bytes) -> str | DecodeError

Since. 1.0.0-beta

Parameters

NameType
b&bytes

Returns

str

Errors

Effects

none declared (pure unless the body says otherwise)

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

See also