# Transforms

Text transforms a field applies before its value is parsed.

`transforms` is a list applied in order. An entry is a name, or an object with one key and its arguments.

| Transform | Type | Description |
|---|---|---|
| `trim` | `name` | Removes leading and trailing whitespace. |
| `lowercase` | `name` | Converts the string to lowercase. |
| `uppercase` | `name` | Converts the string to uppercase. |
| `strip_html` | `name` | Removes HTML markup from the string and decodes entities. |
| `first` | `name` | Keeps the first line of the string. |
| `last` | `name` | Keeps the last line of the string. |
| `replace` | `object` | Replaces every match of a regular expression. |
| `replace.pattern` | `string` | The regular expression to replace. |
| `replace.with` | `string` | The replacement string. |
| `split` | `object` | Splits the string on a separator and keeps one part. |
| `split.index` | `integer` | The 0-based index of the part to keep; a negative index counts from the end. An index the string does not have is a parse failure, handled by `on_invalid`. |
| `split.sep` | `string` | The separator, at least one character. |
| `join` | `object` | Joins the lines of the string into one line. |
| `join.sep` | `string` | The string placed where each line break was. |
| `prefix` | `string` | Adds the given string to the start. |
| `suffix` | `string` | Adds the given string to the end. |
| `slice` | `object` | Keeps the characters from `start` up to `end`, as JavaScript `slice` does, so negative indices count from the end. |
| `slice.end` | `integer` | The index to stop before. Without it, the slice runs to the end. |
| `slice.start` | `integer` | The index of the first character to keep. |
