package irc-client

  1. Overview
  2. Docs

Helper functions for buffering data as it is read from a socket.

val split : str:string -> c:char -> string list

Split a string str at each occurrence of the character c

val split1 : str:string -> c:char -> (string * string) option

split1 ~str ~c returns Some (a, b) where a ^ c ^ b = str if it can, or None otherwise

val split1_exn : str:string -> c:char -> string * string

Same as split1 but unsafe

  • raises Not_found

    if the separator isn't found

val handle_input : buffer:Buffer.t -> input:string -> string list

Given a buffer and a string input, append the input to the buffer, return all whole lines present in the buffer, and reinitialise the buffer to contain only the substring which follows all the whole lines.

OCaml

Innovation. Community. Security.