by www.coderhq.com (5 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 27th March 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Search a string for any given character(s) in reverse.
' Create One Text Box and 1
' Command Button then run
'
' For more code snippets
' please visit
' http://www.coderhq.com
Private Sub Command1_Click()
letterNum = InStrRev(Text1.Text, "jumps", 43)
MsgBox "Starting from the 43rd character and searching backwards, the word ""jumps"" was found starting at character " & letterNum, vbInformation
End Sub
Private Sub Form_Load()
Text1.Text = "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."
End Sub