Array.pairmatch()

From ZCubes Wiki
Revision as of 11:11, 16 February 2020 by Joseph (talk | contribs) (Created page with "* << Z3 Home * Z3 Language Documentation * Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member F...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Array.pairmatch(SomeAtFoldValue, SomeAtReverseFoldValue, SomeStartFrom)

Array.fold folds the array for the corresponding SomeAtFoldValue (and SomeAtReverseFoldValue), into subarrays if the value in the array element matches the given fold value. Array.pairmatch finds the matching pair of SomeAtFoldValue and returns the index. Used for internal advanced uses of parsing.

"a+[a+b]"

  .split("")
  .fold("[").print()

[a,+, [[,a,+,b,] ] ]

(Compare this to the original string "a+[a+b]")


See Also

fold