Module Stdlib.String

include module type of String;
type t = string;
let make: int => char => string;
let init: int => (int => char) => string;
let empty: string;
let of_bytes: bytes => string;
let to_bytes: string => bytes;
let length: string => int;
let get: string => int => char;
let concat: string => list(string) => string;
let cat: string => string => string;
let equal: t => t => bool;
let compare: t => t => int;
let starts_with: prefix:string => string => bool;
let ends_with: suffix:string => string => bool;
let contains_from: string => int => char => bool;
let rcontains_from: string => int => char => bool;
let contains: string => char => bool;
let sub: string => int => int => string;
let split_on_char: char => string => list(string);
let map: (char => char) => string => string;
let mapi: (int => char => char) => string => string;
let fold_left: ('a => char => 'a) => 'a => string => 'a;
let fold_right: (char => 'a => 'a) => string => 'a => 'a;
let exists: (char => bool) => string => bool;
let trim: string => string;
let escaped: string => string;
let uppercase_ascii: string => string;
let lowercase_ascii: string => string;
let capitalize_ascii: string => string;
let uncapitalize_ascii: string => string;
let iter: (char => unit) => string => unit;
let iteri: (int => char => unit) => string => unit;
let index_from: string => int => char => int;
let index_from_opt: string => int => char => option(int);
let rindex_from: string => int => char => int;
let rindex_from_opt: string => int => char => option(int);
let index: string => char => int;
let index_opt: string => char => option(int);
let rindex: string => char => int;
let rindex_opt: string => char => option(int);
let to_seq: t => Seq.t(char);
let to_seqi: t => Seq.t((int, char));
let of_seq: Seq.t(char) => t;
let get_utf_8_uchar: t => int => Uchar.utf_decode;
let is_valid_utf_8: t => bool;
let get_utf_16be_uchar: t => int => Uchar.utf_decode;
let is_valid_utf_16be: t => bool;
let get_utf_16le_uchar: t => int => Uchar.utf_decode;
let is_valid_utf_16le: t => bool;
let create: int => bytes;
  • deprecated Use Bytes.create/BytesLabels.create instead.
let set: bytes => int => char => unit;
  • deprecated Use Bytes.set/BytesLabels.set instead.
let blit: string => int => bytes => int => int => unit;
let copy: string => string;
  • deprecated Strings now immutable: no need to copy
let fill: bytes => int => int => char => unit;
  • deprecated Use Bytes.fill/BytesLabels.fill instead.
let uppercase: string => string;
  • deprecated Use String.uppercase_ascii/StringLabels.uppercase_ascii instead.
let lowercase: string => string;
  • deprecated Use String.lowercase_ascii/StringLabels.lowercase_ascii instead.
let capitalize: string => string;
  • deprecated Use String.capitalize_ascii/StringLabels.capitalize_ascii instead.
let uncapitalize: string => string;
  • deprecated Use String.uncapitalize_ascii/StringLabels.uncapitalize_ascii instead.
let get_uint8: string => int => int;
let get_int8: string => int => int;
let get_uint16_ne: string => int => int;
let get_uint16_be: string => int => int;
let get_uint16_le: string => int => int;
let get_int16_ne: string => int => int;
let get_int16_be: string => int => int;
let get_int16_le: string => int => int;
let get_int32_ne: string => int => int32;
let get_int32_be: string => int => int32;
let get_int32_le: string => int => int32;
let get_int64_ne: string => int => int64;
let get_int64_be: string => int => int64;
let get_int64_le: string => int => int64;
let unsafe_get: string => int => char;
let unsafe_set: bytes => int => char => unit;
  • deprecated
let unsafe_blit: string => int => bytes => int => int => unit;
let unsafe_fill: bytes => int => int => char => unit;
  • deprecated
module Set: Set.S with type elt = string;
module Map: Map.S with type key = string;
module Tbl: Hashtbl.S with type key = string;
let print: Format.formatter => t => unit;
let for_all: (char => bool) => t => bool;