Contents |
Determines the index of the first array element that contains a specified substring.
Array functions
ArrayContains(array,substring)
| Return Type | Return Description |
| number | Index of the first array element that contains substring. If not found, returns zero. |
| Name | Type | Required | Position | Default | Description |
| array | array | Yes | 1 | Name of an array. | |
| substring | string | Yes | 2 | A string or a variable that contains one. The search is case-sensitive. |
<cfset fruit = Array("apples","peaches","oranges","bananas")> <cfif ArrayContains(fruit,"peaches") NEQ 0> <cfoutput>#fruit[ArrayContains(fruit,"peaches")]#</cfoutput> </cfif>
Categories: