Spec-Zone.ru › ColdFusion

listGetAt

Gets a list element at a specified position.

listGetAt(list, position [, delimiters [, includeEmptyValues]]) → returns string

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: listDeleteAt listInsertAt listSetAt

    Argument Reference

    list string
    Required

    position numeric
    Required

    delimiter string
    Default: ,

    includeEmptyValues boolean
    Default: false

    Examples
    Sample code invoking the listGetAt function

    Simple Example

    Returns the 2nd element in the list

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

    Expected Result: bar

    Example with Delimiter

    Returns the 3rd element in the list using a custom delimiter

    listGetAt("foo,bar|lorem,ipsum|me|something", 3, "|")

    Expected Result: me

    Example with IncludeEmptyValues

    Returns the 4th element in the list, treating the empty element as a value

    listGetAt("foo,bar,,lorem,ipsum", 4, ",", true)

    Expected Result: lorem

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/listgetat

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API