package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-libs.stdlib/Tezos_stdlib/TzString/index.html
Module Tezos_stdlib.TzString
Source
split delim ~limit str
splits str
into a list of strings. Splitting occurs on delim
characters (which are removed from output) at most limit
times. Remaining delim
characters are included in the last element of the resulting list.
limit
defaults to max_int
.
This function obeys the invariant that for all limit
s, delim
s and str
s: String.concat (String.init 1 (fun _ -> delim)) (split delim ~limit str) = str
.
Splits a string on a delimiter character. It strips delimiters at the beginning and at the end. It considers groups of delimiters as one. If limit
is passed, stops after limit
split(s). limit
defaults to max_int
. It's guaranteed to never produce empty strings in the output. Therefore, it's capable of producing an empty list as a result.
For example, split_no_empty ',' ",hello,,world,"
returns "hello"; "world"
chunk_bytes n b
chunks the sequence of bytes b
into a list of strings, each of length n
. The last chunk may be a non-empty string of length less than n
, in which case the behaviour of the function depends on whether error_on_partial_chunk
is set:
- If
error_on_partial_chunk
is set, then the function returnsError error_on_partial_chunk
, - Otherwise, the function return the list of chunks, where the last chunk is a non-empty string of length less than
n
.
true
if input has prefix
Some (input with prefix
removed), if string has prefix
, else None
Some (input with suffix
removed), if string has suffix
, else None
Length of common prefix of input strings
Test whether a string contains a given character
Functional iteration over the characters of a string from first to last
Pretty print bytes as hexadecimal string.