JanetDocsSign in with Github

string/format



    cfunction

    (string/format format & values)
    
    Similar to snprintf, but specialized for operating with janet. Returns
    a new string.


2 examplesSign in to add an example
Loading...
# There is a list of formatters here: https://janet-lang.org/capi/writing-c-functions.html


(string/format "With terminal colors: %M" [:array {:key-in "struct"}]) # => "With terminal colors: (\e[33m:array\e[0m {\e[33m:key-in\e[0m \e[35m\"struct\"\e[0m})"
roobie
You can see janet datastructure values by typing:

(string/format "%q" {:a 1 :b 2}) # => {:a 1 :b 2} 
swlkr