Remove from List
Remove from List
Section titled “Remove from List”Type: list-remove-at · Package: Collections Activities v1.0.3 · Output: none
Removes the element at a specific position of the list. Indexes start at 0.
How it works
Section titled “How it works”Removes from list the element at position index, modifying the list directly. The elements that came after it move up one position. If the index does not exist, it fails and the list does not change.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
list | List | — | The list. |
index | int | — | Position of the element to remove, counting from 0. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”This activity does not return a value; it modifies the list in place.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Index … is out of range (list count: …). | The index is negative or does not exist. Use count(list) - 1 for the last element. |
'list' must be a List, got …. | list is not a list (the message shows the type received, or null). |
Example
Section titled “Example”Remove from List list = names index = 0 // removes the first oneList Count list = names → output: remainingRelated activities
Section titled “Related activities”- Clear List — empty the whole list.
- Add to List — add elements.