[swift-evolution] ASCIIString

Jacob Bandes-Storch jtbandes at gmail.com
Sun Dec 13 15:47:19 CST 2015


StaticString provides an "isASCII" boolean property, but manipulating
strings still requires the use of UnicodeScalarView / CharacterView, even
if the strings are statically known to be ASCII-only.

I think it would be nice to have an ASCIIString in the standard library,
similar to StaticString but with the following improvements:

- ASCIIString itself would be MutableCollectionType, with Index == Int for
easy access.

- Its Generator.Element would be something which works with simple + and -
operators (either UInt8, or perhaps a repurposed UnicodeScalar, or a new
ASCIIScalar).

- The ability to create new ASCIIStrings at runtime, by appending/removing
bytes, or by concatenating other ASCIIStrings.

Would anyone else find this useful?

Jacob Bandes-Storch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151213/281e88f4/attachment.html>


More information about the swift-evolution mailing list