Dim RenderExpr As Regex = New Regex(“\.|{([a-z0-9_.-]+)}”, RegexOptions.IgnoreCase Or RegexOptions.Compiled)
StringOutput = RenderExpr.Replace(StringTemplate, Function ( Match )
If (Replacers.ContainsKey(Match.Groups(1).Value)) Then
Return Replacers(Match.Groups(1).Value).ToString()
End If
End Function
)
use it as an invoke code activity;
StringTemplate, StringOutput as variables
Replacers as IDictionary with the substitutions i.e: Replacers = new Dictionary(Of String,Object) From { {“fecha”, “2020-01-02”}, {“hora”, “10:30”} }
then invoke a string template with its substitutions: “siendo las {hora} del {fecha}, vamos a ejecutar este string”
and see the result in StringOutput variable.
it could be used to do similar activity than string interpolation but with strings instead of numbers (Take in mind that strong interpolation is made at compile time).