### Smart String Literal

The Smart String feature makes it easier to handle strings.
Reference: http://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/#content
Example Hello World in Quotes
Log($"This is the string "Hello World in Quotes" "$)
Result:
This is the string "Hello World in Quotes"
Example String in Quotes
Dim s As String = $""a" "b" "c" "d""$
Log(s)
Result:
"a" "b" "c" "d"
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 replacinf multiple vars
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)
'Output
'15:11:02 LED switched ON (12 times).

Changed: , Category: Strings, File: T6C255M1857.htm, ID: 1857