5 th Apr 2020 01:23:02
Hai Friend , Sign In
Chennai City
G. K.
Tamil Nadu Government Holiday List 2018 in English and Tamil   *   Trichy: Wanted - PHP, MySql Programmers. Contact trichy people only 84894 28 444.   *   Indian Railways New Train Number List [Search / Enquiry / Locator / Finder]   *   பன்றிக் காய்ச்சல் பற்றி அறிந்து கொள்ளுங்கள் (Swine Flu H1N1)
See Also
InStrRev Function InStrRev Function
String Functions String Functions
Option Compare Statement Option Compare
Visual Basic Functions Visual Basic Functions
Visual Basic Home Visual Basic Home
Description  Syntax  Return Datatype  Example  Migration

InStr Function - Visual Basic 6.0 (VB 6.0)

Returns the position of the first occurrence of one string within another.
Parameter Description
start Optional. Numeric expression that sets the starting position for each search. Default 1.
string1 Required. String expression being searched.
string2 Required. String expression searched for.
compare Optional. Numeric value indicating the kind of comparison to use when evaluating substrings.

InStr Function's compare argument:
Constants Value Description
vbUseCompareOption -1 Performs a comparison using the setting of the Option Compare statement.
vbBinaryCompare 0 Default. Perform a binary comparison.
vbTextCompare 1 Perform a textual comparison.
vbDatabaseCompare 2 Microsoft Access only. Performs a comparison based on information in your database.

Return Data type:

Dim SearchStr as String, SearchChar as String
SearchStr = "Chennaiiq"
SearchChar = "N"

Statement Result Remark
InStr(1, SearchStr, SearchChar, 1) 4 vbTextCompare
InStr(1, SearchStr, SearchChar, 0) 0 vbBinaryCompare
InStr(5, SearchStr, SearchChar, 1) 5 Second occurrence
InStr(6, SearchStr, SearchChar, 1) 0  
InStr(SearchStr, LCase(SearchChar)) 4  
InStr("", SearchChar) 0  
InStr(4, SearchStr, "") 4 Value of start argument
InStr(Null, SearchChar) Error Invalid use of null
InStr(SearchStr, Null) Error Invalid use of null
Go to top

Migration from Visual Basic 6.0 (VB 6.0) to
  InStr Function in VB Script (VBS)
  InStr Function in JScript (JS)
  InStr Function in ASP (Active Server Page)
  InStr Function in PHP Script
  InStr Function in MS-Access
  InStr Function in MS SQL Server
  InStr Function in Oracle
  InStr Function in C Language
  InStr Function in C++ Language
  InStr Function in Foxpro
  InStr Function in Fortran
  InStr Function in MS Excel Sheet
Go to top

© 2005 - 2007 Chennaiiq.com. All Rights Reserved.

Our Sites: ChennaiIQ.com || Tamil Calendar || Tamil Panchangam || KP Astrology
Our Blogs: Tamil Calendar