Xbasic
*s Function
Syntax
dim result as c = *s(template as c)
Arguments
- templateCharacter
A template containing placeholders to replace with values from locally defined Xbasic variables. Placeholders are enclosed in curly brackets. For example, "Hello {name} from {city}".
Returns
- resultCharacter
Returns a string where placeholders have been replaced with the value defined in the corresponding Xbasic variable.
Description
Replaces placeholders with values defined locally in Xbasic variables.
Discussion
The *s() function support string interpolation. String interpolation allows you to replace placeholders in a string with values. The placeholders are enclosed in curly brackets.
For example:
Example
dim name as c = "Fred" dim city as c = "Boston" dim string as c = "Hello {name} from {city}" ? *s(string) = "Hello Fred from Boston