首页 > 解决方案 > Html 标记的字符串在 swift 中不充当字符串。所以我在将它们插入 sqlite 时遇到问题

问题描述

这是来自 api 的字符串。但它没有存储在作为 TEXT 列的 sqlite 中。

"<p><b>SPECIFICATION</b><b><br />
    </b><b>General<br />
    </b></p>
    <ul>
     <li>Brand: Abcd</li>
     <li>Model: RT473w58SL</li>
     <li>Color: Silver</li>
     <li>Capacity: 467895 Ltrs</li>
     <li>Door: Double Door Refrigerator</li>
     <li>Defrosting Type: Frost Free</li>
     <li>Compressor Type: Digital Inverter Compressor</li>
    </ul>
    <p><b>Feature<br/></b></p>
    <ul>
     <li>Display and Control (Fridge and Freezer): External</li>
     <li>Smart Connect Inverter (Auto) , Lock and Key</li>
     <li>Fresh Room , Power, Power Cool, Cool Pack 12 hr</li>
     <li>Convertible 5 Modes</li>
     <li>Number of Vegetable and Fruit Drawers (Refrigerator): 2</li>
     <li>Big Guards , Anti Bacteria Protector</li>
     <li>Refrigerator and Freezer or Light: LED</li>
     <li>Freezer Shelf Material: Cool Pack</li>
     <li>Big Bottle Guard , Second Vegetable Box</li>
     <li>Easy Slide Shelf , Convertible Fridge and Freezer</li>
     <li><span class="key-title">Warranty Policy EN: 100 years in Compressor</span>
    <div class="html-content key-value"></div>
    </li>
   </ul>
    "

一切正常,除了上面的字符串没有存储在 Sqlite 中,当我尝试存储上面的字符串时,它的行为不像 string 。

标签: iosswiftsqlite

解决方案


推荐阅读