Module Ext_string

Extension to the standard library String module, fixed some bugs like avoiding locale sensitivity

let split_by: ?keep_empty:bool => (char => bool) => string => list(string);

default is false

let split: ?keep_empty:bool => string => char => list(string);

default is false

let ends_with_char: string => char => bool;
let ends_with_then_chop: string => string => option(string);

ends_with_then_chop name ext

ends_with_then_chop "a.cmj" ".cmj"
"a"

This is useful in controlled or file case sensitve system

let for_all_from: string => int => (char => bool) => bool;

for_all_from s start p if start is negative, it raises, if start is too large, it returns true

let rfind: sub:string => string => int;
let tail_from: string => int => string;

tail_from s 1 return a substring from offset 1 (inclusive)

let rindex_neg: string => char => int;

returns negative number if not found

let replace_slash_backward: string => string;

if no conversion happens, reference equality holds

let replace_backward_slash: string => string;

if no conversion happens, reference equality holds

let capitalize_sub: string => int => string;