New Line Command (\n) Not Working With Firebase Firestore Database Strings

后端 未结 6 994
天涯浪人
天涯浪人 2020-12-06 01:36

I\'m making an app with Swift and I\'m using Firebase Firestore. Firestore is a database that has some strings that I put into a UILabel. With some of my stings

6条回答
  •  自闭症患者
    2020-12-06 02:34

    I found I could get newlines into a firestore field by using the String.fromCharCode() function. Firestore seems to need special characters in strings to be the actual character ASCII values and does not reinterpret escape characters.

    i.e.

    "First Line " + String.fromCharCode(13) + "second line"

提交回复
热议问题