fn textOf
The text of UTF-8 bytes: textOf(encode(x, Format.Json)).
Example:
use std.ser { bytesOf, textOf }
fn main() io {
print(textOf(&bytesOf(&"ok"))!)
}Output
ok
@intrinsic("ser.textOf") pub(api) fn textOf(b: &bytes) -> str | DecodeErrorSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
b | &bytes |
Returns
str
Errors
DecodeError@error
Effects
none declared (pure unless the body says otherwise)
Defined in: std/ser/ser.oxl:2336