listSetAt

Replaces the contents of a list element.

listSetAt(list, position, value [, delimiters]) → returns String

Argument Reference for the listSetAt function

list

Required: Yes

position

Required: Yes

value

Required: Yes

delimiters

Required: No
Default: ,
Values:
  • ,
  • |
  • ;
  • chr(9)
  • chr(10)
  • chr(13)

Examples sample code invoking the listSetAt function


Simple Example

Replaces the 2nd list element with 'foo'

listSetAt("bar,lorem,ipsum", 2, "foo")

Expected Result: bar,foo,ipsum


Example with Custom Delimiter

Inserts 'foo' into the list with a custom delimiter

listSetAt("bar|lorem,ipsum|me|something", 2, "foo", "|")

Expected Result: bar|foo|me|something


Fork me on GitHub