---
title: isKnownASCII
framework: swift
role: symbol
role_heading: Instance Property
path: swift/utf8span/isknownascii
---

# isKnownASCII

Returns whether contents are known to be all-ASCII. A return value of true means that all code units are ASCII. A return value of false means there may be non-ASCII content.

## Declaration

```swift
var isKnownASCII: Bool { get }
```

## Discussion

Discussion ASCII-ness is checked and remembered during UTF-8 validation, so this is often equivalent to is-ASCII, but there are some situations where we might return false even when the content happens to be all-ASCII. For example, a UTF-8 span generated from a String that at some point contained non-ASCII content would report false for isKnownASCII, even if that String had subsequent mutation operations that removed any non-ASCII content. note: O(1)
