|
-
Nov 9th, 2000, 10:02 PM
#1
Thread Starter
Member
Hello,
strstriing$ = "\gamez\tony hawk\"
i want to use instr to find the "\"
then, for each \ found, use a for/next to get the text inbetween
so my final result will be
"gamez"
"tony hawk"
My problem is i dont know how to count the "/s"?
any advice
-
Nov 9th, 2000, 10:19 PM
#2
_______
<?>
Code:
Option Explicit
Private Function Tagless(ByVal Text As String) As String
Dim i As Integer
Dim x As Integer, y As String
For i = 1 To Len(Text)
If Mid(Text, i, 1) = "\" Then
x = x + 1
If x = 2 Then
y = y & vbCrLf
x = 1
End If
Else
y = y & Mid(Text, i, 1)
End If
Next
Tagless = y
End Function
Private Sub Form_Load()
Dim strString As String
strString = "\tony\get it\why\not ever if you\dare"
MsgBox Tagless(strString)
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 9th, 2000, 10:26 PM
#3
Thread Starter
Member
-
Nov 9th, 2000, 11:09 PM
#4
Hyperactive Member
u can use the split function instead:
try this:
Code:
Private Sub Command1_Click()
str1 = "\tony\get it\why\not ever if you\dare"
str2 = Split(str1, "\")
For i = 0 To UBound(str2)
Debug.Print str2(i)
Next
End Sub
[Edited by rammy on 11-09-2000 at 11:13 PM]
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
|