Skip to content

StrWriteFmt

Description

Write a formatted string to out from scratch. Equivalent to StrClear(out) followed by StrAppendFmt(out, ...) – any prior contents of out are discarded.

Usage example (Cross-references)

Usage examples (Cross-references)
        Str              s     = StrInit(&alloc);
        StrAppendFmt(&s, "old prefix ");
        StrWriteFmt(&s, "fresh {}", LVAL(42));
        bool ok = (s.length == 8) && (s.data[0] == 'f') && (s.data[s.length - 1] == '2');
        StrDeinit(&s);
Last updated on