Difference between revisions of "NXSL:inList"

137 bytes added ,  16:13, 13 September 2022
m
Text replacement - "^" to "{{deprecated}}"
(Created page with "__NOTOC__ Check if given value is an element of given list. '''Since:''' 1.2.14 == Syntax == inList(''string'', ''separator'', ''value''); == Parameters == :{| |- | ''s...")
 
m (Text replacement - "^" to "{{deprecated}}")
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
{{deprecated}}__NOTOC__
Check if given value is an element of given list.
Check if given value is an element of given list.


Line 12: Line 12:
== Parameters ==
== Parameters ==


:{|
:{| class="wikitable"
|-
|-
| ''string'' || String containing list of elements.
| ''string'' || String containing list of elements.
Line 24: Line 24:
== Return Value ==
== Return Value ==


'''TRUE''' if given value is an element of given list.
'''TRUE''' if given value is an element of given list, '''FALSE''' otherwise.




== Examples ==
== Examples ==


  inList("a,b,c", ",", "a") -> TRUE
<syntaxhighlight lang="c">
  inList("alpha::beta,gamma::delta", "::", "beta") -> FALSE
  inList("a,b,c", ",", "a");                              // TRUE
  inList("alpha::beta,gamma::delta", "::", "beta,gamma") -> TRUE
  inList("alpha::beta,gamma::delta", "::", "beta");      // FALSE
  inList("alpha::beta,gamma::delta", ",", "alpha::beta") -> TRUE
  inList("alpha::beta,gamma::delta", "::", "beta,gamma"); // TRUE
  inList("alpha::beta,gamma::delta", ",", "alpha::beta"); // TRUE
</syntaxhighlight>