How can we write " in nsstring?

后端 未结 6 688
忘了有多久
忘了有多久 2020-12-09 18:56

I have to initialize string as \"Rose\" including Quotation Mark. How to write \" in our string?

6条回答
  •  心在旅途
    2020-12-09 19:41

    In swift 5, you can write with a hashtag :

     let raw = #"You can create "raw" strings in Swift 5."#
    

    Output :

    You can create "raw" strings in Swift 5.
    

提交回复
热议问题