package ocplib_stuff
Library
Module
Module type
Parameter
Class
Class type
Extension of the stdlib String module
for_all fn s
tests whether every characters of s
verify fn
exists fn s
tests whether at least a character of s
verifies fn
before s pos
returns the substring before pos
(the character at position pos
is not included)
after s pos
returns the substring after pos
(the character at position pos
is not included)
starts_with s ~prefix
checks whether s
starts with prefix
ends_with s ~suffix
checks whether s
ends with suffix
cut pos s
returns the substrings of s
before and after the position pos
. The character at position pos
is not included
cut_at c s
returns the substring of s
before and after the position first occurence of character c
.
rcut_at c s
returns the substring of s
before and after the position last occurence of character c
.
split s c
splits the string s
on characters c
, starting from the left. Invariant: String.concat (String.make 1 c) (split s c) = s