JavaScript で substring
JavaScript でも substring できるとわかった(当たり前だが)ので、そのメモ。拡張子の判定をする例。
if( $StringValue.substring($StringValue.lastIndexOf('.'), $StringValue.length) == ".txt" ){ window.alert("This is a text file."); } else { window.alert("This is not a text file."); }