Syntax :
InStr ( [IngStartPos ] , strString1 , str Strine2 [ , compare ] )
InStrB ( [IngStartPos ] , strString1 , str Strine2 [ , compare ] )
IngStartPos : Position in strString1 from which to start the search for strString2
strString1 : String in which to search for strString2
strString2 : String to be searched
compare : Numeric value indicating the kind of comparison to use when evaluating FindValue against the InputStr array. default value is vbBinaryCompare
0 : vbBinaryCompare
1 : vbTextCompare
2 : vbDatabaseCompare
InStr ( [IngStartPos ] , strString1 , str Strine2 [ , compare ] )
InStrB ( [IngStartPos ] , strString1 , str Strine2 [ , compare ] )
IngStartPos : Position in strString1 from which to start the search for strString2
strString1 : String in which to search for strString2
strString2 : String to be searched
compare : Numeric value indicating the kind of comparison to use when evaluating FindValue against the InputStr array. default value is vbBinaryCompare
0 : vbBinaryCompare
1 : vbTextCompare
2 : vbDatabaseCompare
Dim strBye as String
Dim IngPos1 as Integer , IngPos2 as Integer
strBye = "Good Bye"
ingPos1 = InStr ( strBye , "Bye")
ingPos2 = InStr ( 7 , strBye , "Bye")
The first example assigns the value 6 to the variable IngPos1 because the string "Bye" can be found at the sixth position in strBye.
The second example starts the search at position 7; therefore , "Bye" cannot be found. the variable IngPos2 is assigned a value of 0.
Dim IngPos1 as Integer , IngPos2 as Integer
strBye = "Good Bye"
ingPos1 = InStr ( strBye , "Bye")
ingPos2 = InStr ( 7 , strBye , "Bye")
The first example assigns the value 6 to the variable IngPos1 because the string "Bye" can be found at the sixth position in strBye.
The second example starts the search at position 7; therefore , "Bye" cannot be found. the variable IngPos2 is assigned a value of 0.
No comments:
Post a Comment