let items: [String] = ["A", "B", "A", "C", "A", "D"] print(items.enumerated().filter({ $0.element == "A" }).map({ $0.offset })) // -> [0, 2, 4]