proc findIndex(xs: seq[string], y: string): int = for i, x in xs: if x == y: return i return -1 let xs = @["a", "b", "c"] echo findIndex(xs, "a")