[swift-evolution] multi-line string literals
Riley Avron
ravron at dropbox.com
Mon Dec 14 13:03:19 CST 2015
>
> How about this: a pseudo-function that will just include the contents of
> another file into your code?
> let bigString = StringLiteral(“MyLifeStory”)
> You have another file called “MyLifeStory.swiftstring” alongside your
> source file. Then there is no thinking about escaping, line endings, etc.
> Anything in that file is processed as the string.
This makes sense for truly long strings, but could get unwieldy in the case
of a handful of strings spanning a few lines each, which I would posit is
the more common case.
Riley
On 14 December 2015 at 10:56, Kenny Leung via swift-evolution <
swift-evolution at swift.org> wrote:
> How about this: a pseudo-function that will just include the contents of
> another file into your code?
>
> let bigString = StringLiteral(“MyLifeStory”)
>
> You have another file called “MyLifeStory.swiftstring” alongside your
> source file. Then there is no thinking about escaping, line endings, etc.
> Anything in that file is processed as the string.
>
> -Kenny
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151214/7c170fa4/attachment.html>
More information about the swift-evolution
mailing list