Determines the index of a given value if the value occurs within a list of delimited values. If no delimiter is specified, the listGetAt function splits the string using a comma (',') as the delimiter.
JSV_listGetAt(expL, expN [, delimiter])
expL.listGetAt(expN [, delimiter])
Returns the index of the first occurrence of a value within a list. Returns 0 if no value is found. The search is case-sensitive.
The listGetAt function uses the following arguments.
Argument | Description |
expL | Delimited list being searched. |
expN | Element being searched for. |
delimiter | Optional. Single delimiter used in string. Default value is a comma. |
n/a
JSV_isEmpty, JSV_toString, JSV_splitString
The following lines of code
var getElement = 2;
var testList = "green,red,white,blue";
document.write( "The element at position " +
getElement + " is " +
JSV_listGetAt(testList,getElement,',') +
" in the list " + testList.bold() );
produce
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.