# .hasSuffix

**URL:** <https://forums.swift.org/t/hassuffix/19699>\
**Category:** Using Swift\
**Created:** [January 22, 2019, 11:55am UTC](https://forums.swift.org/t/hassuffix/19699 "2019-01-22T11:55:34Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Michael\_Ilseman](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/michael_ilseman/32/44640_2.png) [@Michael\_Ilseman](https://forums.swift.org/u/Michael_Ilseman)\
**Post date:** [January 23, 2019, 6:42pm UTC](https://forums.swift.org/t/hassuffix/19699/15 "2019-01-23T18:42:46Z")

</div>

> [@SDGGiesbrecht](#):
>
> `String` is obligated to preserve the same scalar sequence. If it did not, `String.UnicodeScalarView` , `String.UTF8View` , etc would all break.

Technically, this is unspecified, but I'm pretty strongly in favor of guaranteeing it, at least on a initializer-by-initializer basis (e.g. imagine a future `putMeInNFC` initializer).

Related, we should have lazily-normalized-scalar views for NFC, NFD, NFKC, and NFKD (and _maybe_ FCC, with a compelling reason). This would allow the user can say something like `myString.unicodeScalars.nfkd` to get a `BidirectionalCollection` of `Unicode.Scalar` in NFKD, lazily normalizing segment-by-segment. This was discussed briefly in [String case folding and normalization APIs - #3 by Michael\_Ilseman](https://forums.swift.org/t/string-case-folding-and-normalization-apis/14663/3) and we'll likely revisit it after Swift 5.

---

_[View the full topic](https://forums.swift.org/t/hassuffix/19699)._
