Function
<script > function Evil () { var toint=parseint ("123"); var intvalue=123; var tostr=intvalue.tostring (); var my_friends = "Trixie,moxie,sven,guido,hermes"; var friend_array =my_friends.split (","); for (Loop=0 Loop < friend_array.length;loop++) { Document.writeln (Friend_array[loop] + "is myfriend.<br>"); } } </script>
Microsoft (R) Visual Basic (r) scripting Edition InStrRev Function |
|
Describe
returns the position from the end of a string that appears in another string.
Grammar
InStrRev (
string1
,
string2[
,
Start[
,
Compare]]
)
The syntax for the InStrRev function has the following parameters:
Parameters |
Describe |
String1 |
Must be selected. The string expression that accepts the search. |
string2 |
Must be selected. The string expression being searched for. |
Start |
Optional. A numeric expression that sets the starting position for each search. If omitted, the default value is-1, which indicates that the search begins at the last character position. If start contains Null, an error occurs. |
Compare |
Optional. Indicates the numeric value of the comparison type to use when calculating the substring. If omitted, a binary comparison is performed. For numeric values, see the "Settings" section. |
Set up
The
compare parameter can have the following values:
Constant |
Value |
Describe |
Vbbinarycompare |
0 |
Performs a binary comparison. |
Vbdatabasecompare |
2 |
Execution is based on a comparison of the information contained in the database (performing comparisons in this database). |
return value
InStrRevReturns the following values:
If |
InStrRev return |
string1 is zero length |
0 |
string1 is Null |
Null |
string2 is zero length |
Start |
string2 is Null |
Null |
string2 didn't find it. |
0 |
Find string2 in string1 . |
Find the location of the matching string |
start > Len (string2) |
0 |
Description
The following example uses the
InStrRevFunction search string:
dim searchstring, SearchChar, mypossearchstring = "Xxpxxpxxpxxp" to The string in which to search. SearchChar = "P" ' Search ' P '. The binary comparison starts with the 10th character. Returns 9. MyPos = instrrev ( searchstring SearchChar 10 0 ' text comparison begins with the last character. Returns 12. MyPos = instrrev ( searchstring SearchChar -1 1) ' defaults to binary comparison ( Last argument omitted). Returns 0. MyPos = instrrev ( searchstring SearchChar 8
|
Attention The syntax of the InStrRev function differs from the syntax of the InStr function. |