ConDel() Function in Container | X++ Language
Table of Content:
- The conDel() is used to remove the specified number of elements from a container.
- Syntax: container conDel(container container, int start, int number)
- container - The container from which to remove elements.
- start - The one-based position at which to start removing elements.
- number - The number of elements to delete.
- Return value: A new container without the removed elements.
Example:
Code:
static void Container_conDelExample(Args _args) { // container declaration and initialization with 2 values container containerName = ["Hello", 1202, 'good']; str charHolder; ; // conDel() function removes a value from a specific position in the container. // Here removing 1 value starting from 2nd location containerName = conDel(containerName, 2, 1); info(strFmt("Container containerName conDel() values are :- %1, %2", conPeek(containerName, 1), conPeek(containerName, 2))); }
Output:
The above code will produce the following result-
Container containerName conDel() values are :- Hello, good