---
title: "localizedScanner(with:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/scanner/localizedscanner(with:)"
---

# localizedScanner(with:)

Returns an NSScanner object that scans a given string according to the user’s default locale.

## Declaration

```swift
class func localizedScanner(with string: String) -> Any
```

## Parameters

- `string`: The string to scan.

## Return Value

Return Value An NSScanner object that scans aString according to the user’s default locale.

## Discussion

Discussion Sets the string to scan by invoking init(string:) with aString. The locale is set with Scanner.

## See Also

### Creating a Scanner

- [init(string:)](foundation/scanner/init(string:).md)
