|
-
Sep 25th, 2000, 09:02 PM
#1
Thread Starter
Frenzied Member
how do I search a text box for something like "< body . >"
and it must be in that order.... also if I find something how can I add stuff right after the . (dot) and space?
NXSupport - Your one-stop source for computer help
-
Sep 25th, 2000, 09:16 PM
#2
Use the Instr function.
Code:
If Instr(Text1.text, "<body . >") Then
Msgbox "string found!"
Else
Msgbox "string not found!"
End If
-
Sep 25th, 2000, 09:20 PM
#3
This will add str3 in between the . and > as well
Code:
Private Sub Command1_Click()
Dim pos As Integer
Dim str1, str2, str3 As String
'str1 - text before the .
'str2 - text after the .
'str3 - the string you want to add
str3 = "TEST"
'pos + 7 is the position of the .
pos = InStr(Text1.Text, "< body . >") + 7
str1 = Left(Text1.Text, pos)
str2 = Mid(Text1.Text, pos + 1)
Text1.Text = str1 & str3 & str2
End Sub
Sunny
-
Sep 25th, 2000, 09:22 PM
#4
To add something right after the dot and space:
Code:
Private Sub Command1_Click()
If InStr(Text1.Text, "<body . >") Then
Text1.Text = Replace(Text1.Text, "<body . >", "<body . (replace here)>")
Else
End If
End Sub
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
|