Returns a substring beginning at a specified location and having a specified length.
stringvar.substr(start [, length ])
Arguments
stringvar
Required. A string literal or String object from which the substring is extracted.
start
Required. The starting position of the desired substring. The index of the first character in the string is zero.
length
Optional. The number of characters to include in the returned substring.
<SCRIPT LANGUAGE=javascript>
<!--
var str="jipinsdfsd";
var tmpStr=(str.substr(2,3)).toLowerCase( );
if (tmpStr=='pin')
{
alert("OK");
}
//-->
</SCRIPT>
dim aa 'aa is a string
if substring(aa,3,3)="pin" or substring(aa,3,3)='PIN' then
....
end if
'substring(string,start_position,lenghth) 返回STRING的从start_position 到长为lenghth的子串