[swift-evolution] [Accepted] SE-0168: Multi-Line String Literals

Ben Rimmington me at benrimmington.com
Thu Apr 20 14:12:09 CDT 2017


> On 20 Apr 2017, at 17:48, Adrian Zubarev wrote:
> 
> Some words about the trailing precision. Joe said that we could use \("") as workaround, but if I recall correctly literals are banned from the interpolation itself, which will result in us doing something like this:
> 
> let end = ""
> 
> let myString = """
>    <space><space>foo<space><space>\(end)
>    """
> This is a very dirty and tedious solution for that problem.
> 

<https://github.com/apple/swift/blob/master/CHANGELOG.md#swift-21>

* Expressions interpolated in strings may now contain string literals.
  For example, `My name is \(attributes["name"]!)` is now a valid expression.
  **(14050788)**

-- Ben

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170420/9d627afc/attachment.html>


More information about the swift-evolution mailing list