> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# String: Length equals

> Checks that a string's length matches the given value.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Checks that a string's length matches the given value. A value passes only when it has exactly the number of characters you specify, no more and no fewer. Use this to confirm that a value has a fixed, expected size, for example a country code that must be exactly two characters or a reference number that must be exactly five.

This documentation describes: [Schema](/schemas/condition/string-length)

## Fields

<FormField property="length" label="Length" required>
  The exact number of characters the value must have to match. A value with more or fewer characters does not match.
</FormField>

## Sample data

| Field  | Value |
| ------ | ----- |
| Length | `5`   |

The condition checks each value and answers yes or no:

| Example value | Matches?           |
| ------------- | ------------------ |
| `NL123`       | Yes (5 characters) |
| `NL1234`      | No (6 characters)  |
| `NL12`        | No (4 characters)  |

```json Configuration theme={null}
{
  "prototype": "string-length",
  "parameters": {
    "length": 5
  }
}
```
