Dynamically Create A Printf String Format
let str = Printf.sprintf("%6s", "dope");
/* str => " dope" */let some_num = 6;
let format_str = "%" ++ string_of_int(some_num) ++ "s";
let format = Scanf.format_from_string(format_str, "%s");
let str = Printf.sprintf(format, "dope");
/* str => " dope" */PreviousDefining Variants With Constructor ArgumentsNextExhaustive Pattern Matching Of List Variants
Last updated