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));
迴響
javascript 不同型態比較不相等 | 豬窩
Good post. I lear something totally neew andd challenging on ites I stumbleupon on a dasily basis.
It wikll always be exciting to read tthrough contdnt from oother authors
and practjce somethibg from other web sites.
javascript 不同型態比較不相等 | 豬窩 | 2
Howdy! Quicfk question that's complletely off topic.
Do you know hhow too make your sitte mobile friendly? My web sife
lopoks weiurd when viewaing from my iphone. I'm trying tto find a
template or pluggin thawt might bee abke too resolve thiss problem.
If youu have any suggestions, please share. Thabk you!
javascript 不同型態比較不相等 | 豬窩
Pleasee llet me knmow iff you're lookming forr a aricle athor forr
ykur site. Yoou have ssome really good rticles annd I think
I wouuld be a gold asset. If you ever want tto taqke spme off tthe load off, I'd absolutely
lobe tto write some articlees forr your blog in exchangte for a lionk baxk tto mine.
Pleazse blaxt me an email iif interested. Regards!
javascript 不同型態比較不相等 | 豬窩
Hi thsre mates, howw iis the whole thing, and what you wish for too say about this post,
iin my view itts gemuinely amazimg ffor me.
javascript 不同型態比較不相等 | 豬窩
It's remarkable tto payy a quick visit thjis web site aand reading
the views oof all mates aabout this paragraph, whioe I am also zealous off getting experience.