我粘貼確切的字符串JavaScript顯示:爲什麼在這種情況下string.search失敗?
string: "testare atasament fisier,tip nota - reamintire (1),Diverse,Telefon,Fisier,tip nota Azom" without the ""
substring: "tip nota - reamintire (1)" again without the ""
只是寫那些「」表明,沒有空的空間的任何地方有趣(也在代碼進行覈對)
的
結果string.search(substring);
總是-1,怎麼回事?哪個角色搞亂了搜索?
注意,我不使用的變量名字符串,字符串在我的實際代碼
很好,我想這是在當天爲時已晚,我想簡單的解決方案。謝謝。 – Bogdan