Description
Copy values, append fill until index is reachable, and assign value at index.
A splice replaces part of a list and changes later positions. Cursor affinity defines which side of inserted content a boundary follows when the splice covers it.
Copy values, append fill until index is reachable, and assign value at index.
When to use this tool
Use List Single Gap Padding Policy when you need a splice length, gap-fill, or cursor-mapping calculation.
How to use the tool and how it works
- Enter values, index, value, fill. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read values, padding. Use the output convention below.
Copy values, append fill until index is reachable, and assign value at index. Return the number of inserted gap-fill positions.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| values | Values | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| index | Index | Required. Safe integer; minimum 0; maximum 255. |
| value | Value | Required. Text; maximum UTF-16 length 8192. |
| fill | Fill | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| values | Values | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| padding | Unused or added positions under the stated alignment rule. | Required. Safe integer. |
{
"input": {
"values": [
"a"
],
"index": 3,
"value": "z",
"fill": "_"
},
"output": {
"values": [
"a",
"_",
"_",
"z"
],
"padding": 2
}
} Limitations and assumptions
- Index is limited to 255; assigning inside the original list replaces an item and assigning at its end appends without gap padding.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Check the actual collection API's deletion clamping and cursor semantics before applying an edit.
References
Similar or alternative tools
- List: List Single Splice Length Delta
Clamp deleteCount to the available suffix length.
- List Window Centered Padding Budget
For a valid center and nonnegative radius, return max(0, radius - center) left padding and max(0, center + radius - length + 1) right padding.