VB.NET ASP.NET IndexOf() Source Code Syntax Example
Get 5 Hours of FREE PREMIUM Videos:
LearnVisualStudio.NET Free Preview
“ I am a lifetime member of LearnVisualStudio.net and a Premium Plus member of dotNetVideos.net.
LearnVisualStudio.net is awesome because it grows in value each year as more videos are added.
dotNetVideos.net is also great because it focuses a lot on MS Certifications and practical interview questions.
”
- Wade Harvey (IdealProgrammer.com)
Premium (Not Free) Video Tutorials
Free Video Tutorials & Free Tools
IndexOf Example Syntax VB.NET ASP.NET | IndexOf | Source Code
Summary: – Illustrates using IndexOf with Source Code Syntax Example in VB.NET ASP.NET.
*** 1. Download Source Code *** |
|---|
Download Source Code for All VB ASP.NET Examples in One Project – source code for hundreds of VB.NET ASP.NET examples neatly organized in a single project. |
*** 2. IndexOf Syntax ***
Purpose:
Returns an integer that represents the position of the first occurrence of the
specified number of characters. If you specify startIndex, that specifies
where to start looking. If you specify count, that specifies how many characters to
to search past start. If the string is not found, this method returns -1
Syntax:
string.IndexOf(matchstring[, startIndex][,count])
string.IndexOf(matchstring[, startIndex][,count])
| Parameters | Description | string | Required – string to be searched |
|---|---|
| matchstring | Required – string that you are looking for in parameter1 |
| startIndex | Optional. specifies where to start looking. Zero-based. |
| count | Optional. specifies how many characters to to search past start. |
| Result Data Type | Description | integer | Returns an integer that represents the position of the first occurrence of the specified number of characters. If the string is not found, this method returns -1. The integer returned is a zero-based index so the first position is represented by 0 instead of 1. |
|---|
*** 3. IndexOf – Quick Example *** | Dim strIndexOfExample As String = "This is a test string" TextBox1.Text = strIndexOfExample.IndexOf("is") 'Returns 2 TextBox2.Text = strIndexOfExample.IndexOf("xyz") 'Returns -1 (not found) |
|---|
*** 4. IndexOf – Full Example ***IndexOf Example Output ScreenshotStep 1: Click on Visual Basic to Cut-n-paste code into IndexOf.aspx.vb
Step 2: Click on XML to Cut-n-paste code into IndexOf.aspx
Prerequistes:
Notes:
Instructions:
|
Related posts:
- VB.NET IndexOf() – Code Sample VB.NET IndexOf() - Code Sample...
- VB.NET ASP.NET String Examples – String Examples ASP.NET VB.NET VB.NET ASP.NET String Examples - String Examples ASP.NET VB.NET...
- String.IndexOf Example: JavaScript Syntax – JS String.IndexOf Example String.IndexOf Example: JavaScript Syntax - JS String.IndexOf Example...
- VB.NET ASP.NET Asc Source Code Syntax Example VB.NET ASP.NET Asc Source Code Syntax Example...
- C# ASP.NET String Examples – String Examples ASP.NET C# C# ASP.NET String Examples - String Examples ASP.NET C#...
Related posts brought to you by Yet Another Related Posts Plugin.













































