Add bilingual manual and localized docs routes
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# String
|
||||
|
||||
`String` is the primitive type constraint for string values.
|
||||
|
||||
A string literal is enclosed in `"`.
|
||||
|
||||
```dcdl
|
||||
"hello"
|
||||
"line 1\nline 2"
|
||||
```
|
||||
|
||||
`$`, `{`, and `}` have no special meaning inside a string; Decodal does not perform string interpolation.
|
||||
|
||||
## Examples
|
||||
|
||||
```dcdl
|
||||
name = String;
|
||||
greeting = String default "hello";
|
||||
```
|
||||
|
||||
## Constraint composition
|
||||
|
||||
`String` can be composed with string constraints.
|
||||
|
||||
```dcdl
|
||||
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.
|
||||
Reference in New Issue
Block a user