<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/itemNumber(in:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSAttributedString(im)itemNumberInTextList:atIndex:"
  },
  "title" : "itemNumber(in:at:)"
}
-->

# itemNumber(in:at:)

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

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

## Parameters

`list`

The text list.

`location`

The location of the item.

## Return Value

Returns the index within the list.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)