F-String Expression
F-String Expression is a string literal that is prefixed with f
. It may contain
replacement fields, which are expressions delimited by curly braces {}
.
This is the Kipper variant of templating/string formatting. It works by evaluating the expression inside the curly braces and replacing the curly braces and the expression with the result of the evaluation.
The above expression will be evaluated to Hello World!
if name
is
World
.
Syntax
The syntax of F-String Expression is as follows:
Every expression inside the curly braces will be evaluated and replaced with the result of the evaluation. The rest of the string will be left as is. Expressions may appear anywhere in the string, including the beginning and the end.