package containers

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module CCString.SubSource

Sourcetype t = string * int * int

A string, an offset, and the length of the slice.

Sourceval make : string -> int -> len:int -> t
Sourceval full : string -> t

Full string.

Sourceval copy : t -> string

Make a copy of the substring.

Sourceval underlying : t -> string
Sourceval sub : t -> int -> int -> t

Sub-slice.

Sourceval get : t -> int -> char

get s i gets the i-th element, or fails.

  • since 1.2
include S with type t := t
Sourceval length : t -> int

Return the length (number of characters) of the given string.

Sourceval blit : t -> int -> Bytes.t -> int -> int -> unit

Like String.blit. Compatible with the -safe-string option.

Sourceval fold : ('a -> char -> 'a) -> 'a -> t -> 'a

Fold on chars by increasing index.

  • since 0.7

Conversions

Sourceval to_gen : t -> char gen

Return the gen of characters contained in the string.

Sourceval to_iter : t -> char iter

Return the iter of characters contained in the string.

  • since 2.8
Sourceval to_std_seq : t -> char Seq.t

to_std_seq s returns a Seq.t of the bytes in s.

  • since 2.8
Sourceval to_seq : t -> char sequence
  • deprecated use to_iter or to_std_seq
Sourceval to_klist : t -> char klist
  • deprecated use to_std_seq
Sourceval to_list : t -> char list

Return the list of characters contained in the string.

Sourceval pp_buf : Buffer.t -> t -> unit

Renamed from pp since 2.0.

Sourceval pp : Format.formatter -> t -> unit

Print the string within quotes.

Renamed from print since 2.0.

OCaml

Innovation. Community. Security.