Indexof Function - Millisecond
Có thể bạn quan tâm
Inquisit Language Reference
Searches the list for a value and returns the index.
Member of
<list>
Syntax
list.name.indexOf(value, start)Return Type
integer
Parameters
| Name | Type | Description |
|---|---|---|
| value | value | The value to search for. |
| start | integer | Optional. The index where the search starts. |
Remarks
The indexOf function searches the list for a value and returns the index of the first match. If the value is not found in the list, it returns -1. If the optional start parameter is specified, the search begins at the start position. If start is set to a negative value, the search starts at the given position counting from the end and searches to the end. Otherwise, the search begins with the first item in the list. If there is more than one match in the list, the index of the first match is returned.
Examples
The following code shows how to use function 'indexOf' on list 'myList' to retrieve the first incidence of the item 'Seattle'. By default, the search starts at the first list item at index '0'. The retrieved index is then stored in 'values.index'.
<trial myTrial> / onTrialEnd= {values.index = list.myList.indexOf("Seattle");} </trial>The following code shows how to use function 'indexOf' on list 'myList' to retrieve the first incidence of the item 'Seattle' starting at list index '5' (list items with index 0-4 are ignored in the search for 'Seattle'). The retrieved index is then stored in 'values.index'.
<trial myTrial> / onTrialEnd= {values.index = list.myList.indexOf("Seattle", 5);} </trial>Copyright Millisecond Software, LLC. All rights reserved.
Từ khóa » Hàm Indexof
-
Hàm dexOf() Trong Javascript - Freetuts
-
Hàm IndexOf() Trong JavaScript | Học Lập Trình JavaScript
-
dexOf() - JavaScript - MDN - Mozilla
-
String IndexOf() Trong JavaScript - Hoclaptrinh
-
IndexOf() Trong JavaScript | Tìm Vị Trí Xuất Hiện đầu Tiên Của Một ...
-
Thao Tác Với IndexOf Trong Java - NIIT - ICT Hà Nội
-
JavaScript String IndexOf() Method - W3Schools
-
JavaScript Array IndexOf() Method - W3Schools
-
Hàm INDEX - Microsoft Support
-
Phương Thức IndexOf Trong Java String - Học Java Miễn Phí Hay Nhất
-
IndexOf() Function | Help - Zoho Deluge
-
INDEX Function - SAS Help Center
-
INDEX Function - SAS Help Center