Search a list of records: Difference between revisions

Line 1,851:
data[Select[StringMatchQ[#name, "A*"] &]][1, "population"]</lang>
 
 
=={{header|Nim}}==
<lang Nim>
To solve this task, we define a template “findIt” similar to the templates provided by the standard library module “sequtils”. As First argument it accepts any collection providing a “pairs” iterator (yielding an index and a value), for instance a sequence (list) or a table (hash). The second argument of the template is a predicate, i.e. an expression containing the “it” variable.
Anonymous user