io:format and output
| Format strings | |
| Newline only | |
| Write terms | |
| Raw text |
Format strings
io:format reads a format string and a list of terms. The tilde codes are: ~p for any term readably, ~s for strings, ~w for words, ~n for a newline, and ~f for raw text.
1> io:format("Hello ~p!~n", ["world"]).
Hello world!
ok
~s prints a string, ~w prints a word with quotes, ~f prints the binary as-is.
Next: Let it crash: error handling
Article author: Arthur Isaev