---
title: "reset(toUnchecked:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/utf8span/characteriterator/reset(tounchecked:)"
---

# reset(toUnchecked:)

Reset this iterator to codeUnitOffset, skipping all safety checks.

## Declaration

```swift
mutating func reset(toUnchecked codeUnitOffset: Int)
```

## Discussion

Discussion Note: This is only for very specific, low-level use cases. If codeUnitOffset is not properly scalar-aligned, this function can result in undefined behavior when, e.g., next() is called. If i is scalar-aligned, but not Character-aligned, you may get different results from running Character iteration. For example, this could be used by a regex engine to backtrack to a known-valid previous position.
