ListDeleteAt()
Deletes an element from a list. Returns a copy of the list, without the specified element.
ListDeleteAt( list=string, position=number, delimiters=string, includeEmptyFields=boolean );
Returns: String
| Argument | Description | Default |
|---|---|---|
|
list
string,
required
|
edit
a string list |
|
|
position
number,
required
|
edit
position of the element to delete |
|
|
delimiters
string,
optional
|
edit
Characters that separate list elements. The default value is comma. Alias: delimiter |
, |
|
includeEmptyFields
boolean,
optional
|
edit
if set to true, empty values are included as well |
false |
Examples
editwriteOutput(listDeleteAt("I,love,lucee,testFile", 4));//Expected output I,love,lucee
//Member Function
strList="This,is,a,the,test,file";
writeDump(strList.listDeleteAt(3));//Expected output This,is,the,test,file
See also
- Lists
- Strings
- string.listDeleteAt()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)