fmt

Generated by tinox doc

printf-style string formatting (sprintf/printf/printlnf) supporting %s/%d/%f/%x/%b placeholders. All arguments are passed pre-stringified as a List<String>, not as native typed varargs.

ModuleVersionGroup
format1.0.0tinox.core

Sprintf

import tinox.core.fmt;

class Main
{
    fnc main() -> Int32
    {
        let msg: String = Fmt::sprintf("Hello %s, you are %d years old", ["Alice", "30"]);
        println(msg);

        Fmt::printlnf("balance: $%s (0x%x)", ["42", "255"]);

        return 0;
    }
}

class Fmt

Methods

fn sprintf(format: String, args: List<String>) → String
fn printf(format: String, args: List<String>) → Nothing
fn printlnf(format: String, args: List<String>) → Nothing