javascript 不同型態比較不相等
在取部份字串時, 用 substr 取是 String ,match 取是 Object ,直接 if(substr == match) 傳回 False 必須改字串才能比較,如下:
var str = 'c002';
mstr = str.match(/\d+/).toString();
sstr = str.substr( 1 , 3 ).toString();
alert(mstr + " = " + typeof(mstr) + "\n" + sstr + " = " + typeof(sstr));