ListBeginsWithList

Typeoperator
DictionaryLCB
LibraryLiveCode Builder
Syntax
<Source> begins with <Prefix>
Associationscom.livecode.list
Summary

Determines whether Source begins with Prefix

Parameters
NameTypeDescription
Prefix

An expression which evaluates to a list.

Source

An expression which evaluates to a list.

Example
variable tVar as List
put [1, 2, 3, 4, 5] into tVar

variable tBegins as Boolean
// put tList begins with tList[1] into tBegins -- error: tList[1] is not a list 

put tList begins with [1, 2] into tBegins -- tBegins is true
Values
NameTypeDescription
return

Returns true if Source begins with Prefix.

Description

Source begins with Prefix if and only if the elements of Prefix occur as an initial subsequence of the elements of Source.

Note: Since the empty list is an initial subsequence of every list, every list begins with the empty list.

Tagslists