123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778(** Interface for {{!Core.Substring}[Substring]}. *)open!ImportmoduletypeS=sig(** The type of strings that type [t] is a substring of. *)typebase(** [sexp_of_t] is equivalent to [String.sexp_of_t (to_string t)] *)typet[@@derivingsexp_of,quickcheck]includeIndexed_container.S0withtypet:=twithtypeelt:=charvalbase:t->base(** [pos] refers to the position in the base string, not any other substring that this
substring was generated from. *)valpos:t->int(** Per [String.get] and [Bigstring.get], this raises an exception if the index is out
of bounds. *)valget:t->int->char(** [create ?pos ?len base] creates a substring of the base sequence of
length [len] starting at position [pos], i.e.,
{[ base.[pos], base.[pos + 1], ... base.[pos + len - 1] ]}
An exception is raised if any of those indices into [base] is invalid.
It does not copy the characters, so mutating [base] mutates [t] and vice versa.
*)valcreate:?pos:int->?len:int->base->tvalsub:?pos:int->?len:int->t->t(** {2 Blit functions}
For copying characters from a substring to and from both strings and substrings. *)valblit_to_string:t->dst:bytes->dst_pos:int->unitvalblit_to_bytes:t->dst:bytes->dst_pos:int->unitvalblit_to_bigstring:t->dst:Bigstring.t->dst_pos:int->unitvalblit_from_string:t->src:string->src_pos:int->len:int->unitvalblit_from_bigstring:t->src:Bigstring.t->src_pos:int->len:int->unit(** {2 String concatenation} *)(** These functions always copy. *)valconcat:tlist->tvalconcat_string:tlist->stringvalconcat_bigstring:tlist->Bigstring.t(** {2 Conversion to/from substrings} *)(** These functions always copy. *)valto_string:t->stringvalto_bigstring:t->Bigstring.t(** These functions always copy. Use [create] if you want sharing. *)valof_string:string->t[@@deprecated"[since 2017-11] use [create] instead"]valof_bigstring:Bigstring.t->t[@@deprecated"[since 2017-11] use [create] instead"](** {2 Prefixes and suffixes}
The result of these functions share data with their input, but don't mutate the
underlying string. *)valdrop_prefix:t->int->tvaldrop_suffix:t->int->tvalprefix:t->int->tvalsuffix:t->int->tend