listInsertAt

Inserts an element in a list.

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

listInsertAt Argument Reference

list
Required

position
Required

value
Required

delimiters
Default: ,

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

Examples sample code invoking the listInsertAt function


Simple Example

Inserts 'foo' into the list at position 2

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

Expected Result: bar,foo,lorem,ipsum


Example with Custom Delimiter

Inserts 'foo' into the list with a custom delimiter

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

Expected Result: bar|foo|lorem,ipsum|me|something


Fork me on GitHub