---
title: scanLocation
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/scanner/scanlocation
---

# scanLocation

The character position at which the receiver will begin its next scanning operation.

## Declaration

```swift
var scanLocation: Int { get set }
```

## Discussion

Discussion Raises an NSRangeException if index is beyond the end of the string being scanned. This property is useful for backing up to rescan after an error. Rather than setting the scan location directly to skip known sequences of characters, use scanString(_:into:) or scanCharacters(from:into:), which allow you to verify that the expected substring (or set of characters) is in fact present.

## See Also

### Configuring a Scanner

- [caseSensitive](foundation/scanner/casesensitive.md)
- [charactersToBeSkipped](foundation/scanner/characterstobeskipped.md)
- [locale](foundation/scanner/locale.md)
