# `Ash.Type.String`
[🔗](https://github.com/ash-project/ash/blob/v3.23.1/lib/ash/type/string.ex#L5)

Stores a string in the database.

A built-in type that can be referenced via `:string`.

By default, values are trimmed and empty values are set to `nil`.
You can use the `allow_empty?` and `trim?` constraints to change these behaviors.

### Constraints

* `:max_length` (`t:non_neg_integer/0`) - Enforces a maximum length on the value

* `:min_length` (`t:non_neg_integer/0`) - Enforces a minimum length on the value

* `:match` (`t:Regex.t/0`) - Enforces that the string matches a passed in regex

* `:trim?` (`t:boolean/0`) - Trims the value. The default value is `true`.

* `:allow_empty?` (`t:boolean/0`) - If false, the value is set to `nil` if it's empty. The default value is `false`.

# `handle_change?`

# `prepare_change?`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
