ITLab.Template.DevPack.Formatters
Provides tokenization and value-extraction utilities for template-style formatted strings.
Componentes
| Tipo | Nome | Responsabilidade |
|---|---|---|
| Enum | EFormatStringTokenType | Classifies a token as ConstantText or DynamicValue |
| Class | FormatStringToken | Represents a single parsed token with its type and raw text |
| Class | FormattedStringValueExtracter | Parses a format template and extracts dynamic values from a matching input string |
Como usar
// Extract dynamic segments from a known string template.
var tokens = FormattedStringValueExtracter.Extract(
input: "Order-12345-Confirmed",
format: "Order-{orderId}-{status}");
var orderId = tokens["orderId"]; // "12345"
var status = tokens["status"]; // "Confirmed"
O que não fazer
- Do not use these formatters as a general-purpose template engine for rendering HTML or SQL.
- Do not rely on
FormattedStringValueExtracterfor security-sensitive parsing — it performs no sanitization.
Extensão pelo produto
- Products can build notification message builders on top of
FormattedStringValueExtracterto bind dynamic data into predefined message templates.