Progress Monitor for IdealProgrammer.com
Take Swift, Intelligent, Massive, Planned, Loving, Effective (S.I.M.P.L.E.) Action to Transform Self into Ideal
Skip Repetitive Navigational Links
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console
Please login
VB.NET InStr()
Description:
Illustrates using VB.NET InStr() Code Example.
Example Class:
Public Class clsInStr Public Sub Main() '**************************************************************************************** ' Example #1: InStr(startIndex, string1, string2) ' Returns an integer that represents the position of the first occurrence of ' the second string in the first string. The search starts at the specified ' position in the string. If the string is not found, the result is 0 '**************************************************************************************** Console.WriteLine("Example #1: Len(strField)") Dim strField1 As String = " This " Dim strField2 As String = "is" Console.WriteLine(InStr(1, strField1, strField2)) 'Returns 4 - spaces are counted 'write blank line to make output easier to read Console.WriteLine() 'Prevent console from closing before you press enter Console.ReadLine() End Sub End Class
Example Module:
Module Module1 Sub Main() Dim myclsInStr As New clsInStr myclsInStr.Main() End Sub End Module
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console