Summary
Creates a text transformation from the provided template, using the specified placeholder.
Syntax
[CakeMethodAlias]
public static TextTransformation<TextTransformationTemplate> TransformText(this ICakeContext context, string template, string leftPlaceholder, string rightPlaceholder)
Examples
This sample shows how to create a
TextTransformation<TTemplate> using
the specified template and placeholder.
string text = TransformText("Hello {subject}!", "{", "}")
.WithToken("subject", "world")
.ToString();
Attributes
Parameters
| Name |
Type |
Description |
| context |
ICakeContext |
The context. |
| template |
string |
The template. |
| leftPlaceholder |
string |
The left placeholder. |
| rightPlaceholder |
string |
The right placeholder. |
Return Value