package fmlib
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=0558665285e4d7691e5a80c90ab05a7acb86c09f03ceef6589f150f6d3574573
md5=fb61f4d6e7233cf8d1d71758e6110c1e
doc/fmlib.fmlib_std/Fmlib_std/String/index.html
Module Fmlib_std.String
Source
A small wrapper around Stdlib.String
with some extra functions.
Use Stdlib.String
if you need functions from the ocaml standard library which are not in this module.
A standard ocaml string.
compare s1 s2
Compare the strings s1
and s2
.
Return -1
, if s1
is lexicographically smaller than s2
Return 0
, if both string are equal Return +1
, if s1
is lexicographically greater than s2
find p start str
Find the position of the first character starting from start
in the string str
which satisfies the predicate p
. If no character can be found return the length of the string.
has p start str
Does the string str
starting from position start
have a character satisfying the predicate p
?
find_bwd p beyond str
Find the position of the first character before beyond
in the string str
which satisfies the predicate p
. Return -1
, if no character can be found.
get str i
The i
th character of the string str
.
Precondition: 0 <= i && i < length str
sub str start len
The substring of str
starting at start
with length len
.
Precondition: 0 <= start <= start + len <= length str
concat sep str_list
Concatenate the strings in the string list str_list
and put the separator sep
between them.
split_on_char c str
Split the string str
on each occurrence of the character c
into a list of strings.
init n f
Make a string of length n
where the i
th character is f i
.
Conversion of a source of characters to a string.