Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 680 Bytes

inlist.adoc

File metadata and controls

40 lines (32 loc) · 680 Bytes

inList()

Important

Deprecated in 5.0.

Replaced with method split() of the string instance. Sample usage: "b" in "a,b,c".split(",")

inList(string, separator, token) => Boolean

Split input string by separator into elements and compare each element with token.

Table 1. Parameters

string

Input string.

separator

Elements separator.

token

Pattern to compare with.

Return

True if token is found in input string.

Example
>>> inList("1,2,3", ",", "1")
true
>>> inList("ab|cd|ef", "|", "test")
false