List/Set.at(N)

Tinderbox Icon


Operator Type:   Function
Operator Scope of Action:   Item
Operator Purpose:   Data manipulation

List.at(N)

New to v5.7.1, this returns the Nth value of the List as a string. List can be either Set or List type attributes (or string literal, regex pattern, or expression equivalents thereof).

The operator is zero-based, i.e. an N value of 0 returns the first list item, an N of 1 returns value #2, etc. If the value of N exceeds the number of items in the list an empty string (blank value) is returned. A negative number returns an item numbering in reverse - but one-based not zero-based - so '-1' returns the last item on the list, '-2' the last but one item, etc..

Examples (where $MyList is "ant;bee;cow"):

$MyString = $MyList.at(0) returns "ant"

$MyString = "XX;YY;ZZ".at(2) returns "ZZ"

$MyString = $MyList.at(5) returns "" (nothing) 

$MyString = $MyList.at(-2) returns "bee"


Possible relevant notes (via "Similar Notes" feature):

Up: Item-based operators

A Tinderbox Reference File : Actions & Rules : Operators : Action Operator Scope : Item-based operators : List/Set.at(N)

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox