TextTransformationAliases.

TransformText(ICakeContext, string) Method

Summary

Creates a text transformation from the provided template.
Namespace
Cake.Common.Text
Containing Type
TextTransformationAliases

Syntax

[CakeMethodAlias]
public static TextTransformation<TextTransformationTemplate> TransformText(this ICakeContext context, string template)

Examples

This sample shows how to create a TextTransformation<TTemplate> using the specified template.
string text = TransformText("Hello <%subject%>!")
   .WithToken("subject", "world")
   .ToString();

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.

Parameters

Name Type Description
context ICakeContext The context.
template string The template.

Return Value

Type Description
TextTransformation<TextTransformationTemplate> A TextTransformation<TTemplate> representing the provided template.