From 5dc5766def04d989962e632eb8b41fc0587904a8 Mon Sep 17 00:00:00 2001 From: JalonSolov Date: Tue, 15 Nov 2022 11:33:33 -0500 Subject: [PATCH] doc: minor update for $\{\} (#16440) --- doc/docs.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/docs.md b/doc/docs.md index e093daae93..ffa58b08c4 100644 --- a/doc/docs.md +++ b/doc/docs.md @@ -600,15 +600,15 @@ For more advanced `string` processing and conversions, refer to the #### String interpolation -Basic interpolation syntax is pretty simple - use `$` before a variable name. The variable will be -converted to a string and embedded into the literal: +Basic interpolation syntax is pretty simple - use `${` before a variable name and `}` after. The +variable will be converted to a string and embedded into the literal: ```v name := 'Bob' println('Hello, ${name}!') // Hello, Bob! ``` -It also works with fields: `'age = $user.age'`. If you need more complex expressions, use `${}`: +It also works with fields: `'age = ${user.age}'`. You may also use more complex expressions: `'can register = ${user.age > 13}'`. Format specifiers similar to those in C's `printf()` are also supported. `f`, `g`, `x`, `o`, `b`,