我有以下字符串,我需要到數據庫存儲和檢索的目的一行:清理字符串
{"id":8,"heading":"heading goes here","content":"<p>
content goes here</p>
"}
我使用下面的命令來得到這個到一個行:
Dim strContent As String = Request.Form("strContent").Replace(vbCr, "").Replace(vbLf, "")
這使上面的字符串到一個行,如下所示:
{"id":8,"heading":"heading goes here","content":"<p> content goes here</p>"}
然而,串有S內eems是一個「標籤」字符
我該如何擺脫?
我想我需要這樣做,除非有更好的方法。當我從數據庫中提取字符串時,如果字符串包含我想要刪除的任何位,它將生成無效的json對象。 – oshirowanen 2011-02-07 10:16:08