2021-08-29

How to find first index of an element in array of arrays

I have an array of arrays like

var arr = [[("aa",1),("b",2)],[("c",3),("dd",4)],[("e",5),("f",6)]]

I want to find first index of dd in arr. I am trying this code but failed to get result

let val = arr.first(where: {$0.1 == "dd" })


from Recent Questions - Stack Overflow https://ift.tt/3BpW9Tb
https://ift.tt/eA8V8J

No comments:

Post a Comment