### Examples

Various examples.
Example Hello World in quotes
Log($"This is the string "Hello World in Quotes" "$)
Result:
This is the string "Hello World in Quotes"
Example calculating a value using placeholders
Log($"My favorite number is 3 * 3 = ${3 * 3}"$)
Result:
My favorite number is 3 * 3 = 9
Example current date and time
Dim dt As String = $"$DateTime{DateTime.Now}"$
Log(dt)
Result:
05/14/2015 09:47:10
Example replacing a variable
Dim x As Int = 1958
Dim s As String = $"The value of x is ${x}"$
Log(s)
Result:
The value of x is 1958
Example percent
Dim pct As Double = 25
Log($"You get a discount of $2{pct}%"$)
Result:
You get a discount of 25%
Example replacing multiple variables
Dim IsState As Boolean = True
Dim cnt As Int = 12
Dim State As String
Dim StateMsg As String
If IsState = True Then
State = "ON"
Else
State = "OFF"
End If
StateMsg = $"${DateTime.Time(DateTime.Now)} LED switched ${State} (${cnt} times)."$
Log(StateMsg)
Result:
15:11:02 LED switched ON (12 times).
Example string in quotes
Dim s As String = $""a" "b" "c" "d""$
Log(s)
Result:
"a" "b" "c" "d"
Example float with digits
Dim temperature, pressure As Float
...
Log($"Temperature: $1.2{temperature}°"$)
Log($"Pressure: $1.4{pressure} mBar"$)
Result:
Temperature: 20.38°
Pressure: 1,029.15 mBar

Changed: , Category: Smart String Literal, File: T6C251M1808.htm, ID: 1808