|
-
Apr 29th, 2000, 09:07 PM
#1
Thread Starter
Addicted Member
Hi,
Is there any way to search for string backward ? I have a Richtextbox that contain a text and the user search for staring, how can i search back?
Thanks
-
Apr 30th, 2000, 12:27 AM
#2
If you have VB6 check out the InStrRev function in the MSDN library.
Good luck!
-
Apr 30th, 2000, 05:21 AM
#3
Member
See if my code would help you. Open a new project and put a text box control on it. Erase Text caption in proporties.
Then just copy my code in.
Option Explicit
Private Sub Form_Load()
'Looking for a space starting from the end of the string
Dim i As Integer
dim iSpace As Integer
Text1 = "I like to go out once in a while"
y = 1
For i = Len(Text1) To 1 Step -1
iSpace = InStr(i, Mid(Text1, 1, i), " ")
If iSpace > 0 Then
MsgBox "Found space in position " & iSpace
End If
Next
End Sub
Let me know if it would help you.
-
Apr 30th, 2000, 08:28 PM
#4
Thread Starter
Addicted Member
Hi,
mlana the "Joacim Andersson" method was much faster !
Thanks for the reply
P.S. - can Search in RichTextbox - in 1 command the all occures that iam looking for??
Thnks again
-
Apr 30th, 2000, 08:35 PM
#5
Member
Thank you for letting me know that.
But I am working with VB5 and I did not find this function
there. Am I missing something or it is new for VB6?
-
May 1st, 2000, 03:15 AM
#6
InStrRev is a new function in VB6.
-
May 1st, 2000, 11:25 AM
#7
Thread Starter
Addicted Member
Joacim
In the RichTextBox there is a command "Find", Do u know if there any option to find ALL search argument in 1 command without any loop? (i am editing a large amount of data and the user like to search the textbox?) what is the best way to do that?
Tia
-
May 1st, 2000, 05:54 PM
#8
There is no such options. You would have to use a loop.
Good luck!
-
May 2nd, 2000, 04:19 PM
#9
Thread Starter
Addicted Member
Thanks
Thanks To All Replyers...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|