---
title: "NSMakeRange(_:_:)"
framework: foundation
role: symbol
role_heading: Function
path: "foundation/nsmakerange(_:_:)"
---

# NSMakeRange(_:_:)

Creates a new NSRange from the specified values.

## Declaration

```swift
func NSMakeRange(_ loc: Int, _ len: Int) -> NSRange
```

## Return Value

Return Value An NSRange with location location and length length.

## See Also

### Managing ranges

- [NSEqualRanges(_:_:)](foundation/nsequalranges(_:_:).md)
- [NSIntersectionRange(_:_:)](foundation/nsintersectionrange(_:_:).md)
- [NSLocationInRange(_:_:)](foundation/nslocationinrange(_:_:).md)
- [NSMaxRange(_:)](foundation/nsmaxrange(_:).md)
- [NSRangeFromString(_:)](foundation/nsrangefromstring(_:).md)
- [NSStringFromRange(_:)](foundation/nsstringfromrange(_:).md)
- [NSUnionRange(_:_:)](foundation/nsunionrange(_:_:).md)
