package bracetax

  1. Overview
  2. Docs

Utility functions for sanitization of strings.

val replace_string : src:string -> find:string -> replace_with:string -> string
val replace_chars : src:string -> patterns:(char * string) list -> string

Replace characters by strings. For example:

let patterns = [('<', "&lt;"); ('>', "&gt;"); ('&', "&amp;")] in
Escape.replace_chars ~src:line ~patterns 
val is_white_space : string -> bool
val clean_string : string -> string

Cleans a string to use only A-Z, a-z, 0-9, _ characters.

OCaml

Innovation. Community. Security.