> ## 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: Cut

> Cuts a string at the provided length value starting the count at the start 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>;
};

Keeps only a portion of a value, measured by character position. Use this to pull a fixed segment out of a longer piece of text, such as taking the first few characters of a code, dropping a known prefix, or grabbing a section from the middle of an identifier. You choose where the cut begins and, optionally, how many characters to keep.

This documentation describes: [Schema](/schemas/mapper/string-cut)

## Fields

<FormField property="start" label="Start" required>
  Where to start counting, as a character position. Counting begins at `0`, so `0` is the first character, `3` skips the first three characters, and so on. A negative number counts back from the end, so `-4` starts four characters before the end.
</FormField>

<FormField property="length" label="Length">
  How many characters to keep from the start position. Leave it empty to keep everything from the start position to the end of the value. A negative length stops that many characters before the end.
</FormField>

## Sample data

| Field  | Value |
| ------ | ----- |
| Start  | `0`   |
| Length | `5`   |

Input:

```json theme={null}
{ "sku": "SHIRT-001-RED" }
```

Output:

```json theme={null}
{ "sku": "SHIRT" }
```

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