我有一個關於在javascript中分割字符串的問題。我從別的地方得到一個字符串,我只想得到它的一部分。我不能使用substr,因爲它的長度可以改變。我也看了拆分方法,但這還不夠。例如,我的一個字符串看起來像這樣:javascript tokenizer
<img src="http://image.weather.com/web/common/wxicons/31/30.gif?12122006" alt="" />Partly Cloudy, and 84 ° F. For more details?
我只想獲得img標籤和數字84.任何建議?謝謝
什麼是你的字符串,例如常數,是'° 「所有字符串都存在? – Sirko 2012-07-25 11:15:37
只有img源,「部分多雲」和數字可以改變。休息是一樣的 – 2012-07-25 11:25:57