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
Printable View
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
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
Thanks HeSaidJoe
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]