Logo

Programming-Idioms

History of Idiom 12 > diff from v28 to v29

Edit summary for version 29 by :
[Pascal] imports format

Version 28

2016-01-10, 00:48:55

Version 29

2016-01-21, 09:08:54

Idiom #12 Check if list contains a value

Check if list contains a value x.
list is any iterable finite container.

Idiom #12 Check if list contains a value

Check if list contains a value x.
list is any iterable finite container.

Imports
classes
Imports
uses classes;
Code
result := list.IndexOf(x) <> -1;
Code
result := list.IndexOf(x) <> -1;
Comments bubble
If list is a TStrings-descendant
Comments bubble
If list is a TStrings-descendant