VB.Net String IndexOf()

IndexOf(ByVal value As String) As Integer
Reports the index of the first occurrence of the specified System.String in this instance.

Return Values :
The index position of value if that string is found, or -1 if it is not. If value is System.String.Empty, the return value is 0.

Ex : 

"vbcodesblog".IndexOf("codes") returns 2


 Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox("vbcodesblog".IndexOf("codes"))
    End Sub
 End Class


When you execute this code, you will get 2 in the MessageBox
Anda baru saja membaca artikel yang berkategori VB.Net dengan judul VB.Net String IndexOf(). Anda bisa bookmark halaman ini dengan URL https://vbcodesblog.blogspot.com/2010/04/vbnet-string-indexof.html. Terima kasih!
Ditulis oleh: Farray Cool - Saturday, April 10, 2010

Belum ada komentar untuk "VB.Net String IndexOf()"

Post a Comment