Description
Pad values to at least padTo with padValue and truncate to truncateTo in one order; repeat with truncation first.
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.
Pad values to at least padTo with padValue and truncate to truncateTo in one order; repeat with truncation first.
When to use this tool
Use List Pad Truncate Operation Order when you need a splice length, gap-fill, or cursor-mapping calculation.
How to use the tool and how it works
- Enter values, padTo, truncateTo, padValue. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read padThenTruncate, truncateThenPad, equal. Inspect equal before interpreting the associated values.
Pad values to at least padTo with padValue and truncate to truncateTo in one order; repeat with truncation first. Compare the resulting arrays exactly.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| values | Values | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| padTo | Pad To | Required. Safe integer; minimum 0; maximum 256. |
| truncateTo | Truncate To | Required. Safe integer; minimum 0; maximum 256. |
| padValue | Pad Value | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| padThenTruncate | Pad Then Truncate | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| truncateThenPad | Truncate Then Pad | Required. Array of text; maximum UTF-16 length 8192; maximum items 256. |
| equal | Equal | Required. Boolean. |
{
"input": {
"values": [
"a"
],
"padTo": 3,
"truncateTo": 2,
"padValue": "x"
},
"output": {
"padThenTruncate": [
"a",
"x"
],
"truncateThenPad": [
"a",
"x",
"x"
],
"equal": false
}
} Limitations and assumptions
- Padding never removes items and truncation keeps the prefix; limits are 0-256 and no list is modified in place.
- 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 Ragged Row Padding Budget
Choose the maximum nonnegative row length, or zero for no rows.
- List: List Insertion Cursor Shift
Shift cursor by insertedCount when it lies after insertionIndex or equals it with after affinity.