Files
Decodal/doc/manual/source/language/value/string.md
T

642 B

String

String is the primitive type constraint for string values.

A string literal is enclosed in ".

"hello"
"line 1\nline 2"

$, {, and } have no special meaning inside a string; Decodal does not perform string interpolation.

Examples

name = String;
greeting = String default "hello";

Constraint composition

String can be composed with string constraints.

message = String & /Hello! .*/;

Enable regex-constraint validation with the Rust crate's regex feature. Without that feature, a regex constraint cannot be validated against a concrete string and produces a diagnostic.