---
title: "scanCharacters(from:into:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/scanner/scancharacters(from:into:)"
---

# scanCharacters(from:into:)

Scans the string as long as characters from a given character set are encountered, accumulating characters into a string that’s returned by reference.

## Declaration

```swift
func scanCharacters(from set: CharacterSet, into result: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool
```

## Parameters

- `set`: The set of characters to scan.
- `result`: Upon return, contains the characters scanned.

## Return Value

Return Value true if the receiver scanned any characters, otherwise false.

## Discussion

Discussion Invoke this method with NULL as stringValue to simply scan past a given set of characters.

## See Also

### Scanning Characters and Strings

- [scanUpToCharacters(from:into:)](foundation/scanner/scanuptocharacters(from:into:).md)
- [scanString(_:into:)](foundation/scanner/scanstring(_:into:).md)
- [scanUpTo(_:into:)](foundation/scanner/scanupto(_:into:).md)
