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

# reset(toUnchecked:)

Reset this iterator to codeUnitOffset, skipping all safety checks (including bounds 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. For example, this could be used by a regex engine to backtrack to a known-valid previous position. note: O(1)
