Class TemplateToken
An individual token produced by Parse(string).
public sealed record TemplateToken : IEquatable<TemplateToken>
- Inheritance
-
TemplateToken
- Implements
- Inherited Members
Properties
IsConditional
Whether this segment is optional (uses the ? suffix in the template).
public bool IsConditional { get; init; }
Property Value
IsLiteral
Whether this token is a literal text fragment.
public bool IsLiteral { get; init; }
Property Value
LiteralText
public string? LiteralText { get; init; }
Property Value
SegmentKey
public string? SegmentKey { get; init; }
Property Value
Methods
Literal(string)
Creates a literal text token.
public static TemplateToken Literal(string text)
Parameters
textstring
Returns
Segment(string, bool)
Creates a segment placeholder token.
public static TemplateToken Segment(string key, bool conditional)