> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Function array_length

Module: `noir_aztec::protocol::utils::arrays`

```rust
pub fn array_length<T, let N: u32>(array: [T; N]) -> u32
where
    T: Empty
```

Helper function to count the number of non-empty elements in a validated array. Danger: This is only safe to call if the input arrays have been "validated" (dense lhs, empty rhs).

1. All elements before the first empty element are non-empty
2. All elements after and including the first empty element are empty
3. The array forms a contiguous sequence of non-empty elements followed by empty elements
