---
title: "itemNumber(in:at:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsattributedstring/itemnumber(in:at:)"
---

# itemNumber(in:at:)

Returns the index of the item at the specified location within the list.

## Declaration

```swift
func itemNumber(in list: NSTextList, at location: Int) -> Int
```

## Parameters

- `list`: The text list.
- `location`: The location of the item.

## Return Value

Return Value Returns the index within the list.

## See Also

### Calculating ranges for common elements

- [range(of:at:)](foundation/nsattributedstring/range(of:at:)-1wrcp.md)
- [range(of:at:)](foundation/nsattributedstring/range(of:at:)-6um0x.md)
- [range(of:at:)](foundation/nsattributedstring/range(of:at:)-3fevu.md)
