我會像下面得到兩個符號之間的字符串中的字符串,並將其推到一個數組
var str = "-#A
This text belongs to A.
Dummy Text of A.
-#B
This text belongs to B.
Dummy Text of B.
-#C
This text belongs to C.
Dummy text of C.
-#Garbage
This string should be ignored"
我要像下面忽略文本爲「垃圾」
var arr = [["A","This text belongs to A.
Dummy Text of A."],["B","This text belongs to B.
Dummy Text of B."] etc...]
標題數組的字符串
請幫我。我怎樣才能做到這一點...
我假設你的引號應該在「這個字符串被忽略..」之後,而不是在「C的虛擬文本」之後。 – Jeff 2012-01-18 03:37:37
@Jeff是的,我正在編輯。謝謝 – Exception 2012-01-18 03:39:34
是隻有一行或「\ n」新行有嗎??? – 2012-01-18 03:44:43