|
-
Aug 8th, 2009, 08:07 PM
#1
Re: Remove double String from a String
This does it. Add a command button to a form and then click on it after adding this code:
Code:
Private Sub Command1_Click()
Dim Str1 As String, Str2 As String
Str1 = "steve.K=T:qbe.K=T:qbe.K=T:qbe.K=T:"
Str2 = "987654321_qn?K.X1_qn?K.X1_qn?K.X1_"
Str1 = Left$(Str1, InStr(Str1, ".") - 1)
Str2 = Left$(Str2, InStr(Str2, "_") - 1)
MsgBox Str1 & vbCrLf & Str2
End Sub
-
Aug 8th, 2009, 08:19 PM
#2
Thread Starter
Fanatic Member
Re: Remove double String from a String
 Originally Posted by Code Doc
This does it. Add a command button to a form and then click on it after adding this code:
Code:
Private Sub Command1_Click()
Dim Str1 As String, Str2 As String
Str1 = "steve.K=T:qbe.K=T:qbe.K=T:qbe.K=T:"
Str2 = "987654321_qn?K.X1_qn?K.X1_qn?K.X1_"
Str1 = Left$(Str1, InStr(Str1, ".") - 1)
Str2 = Left$(Str2, InStr(Str2, "_") - 1)
MsgBox Str1 & vbCrLf & Str2
End Sub
hmm Thanks ,
but i think you didnt understand me good cause i cant use only . or _ everytime i can have different string so i should make it dynamic
here you other example
Code:
brad123]slI,Z3]slI,Z3]slI,Z3]
12345~mj!D2[5~mj!D2[5~mj!D2[5~mj
steve.K=T:qbe.K=T:qbe.K=T:qbe.K=T:
987654321_qn�K.X1_qn�K.X1_qn�K.X1_
must be like
brad123
12345
steve
987654321
Thanks cause i really tried to get an algo for that but i couldnt get it
-
Aug 8th, 2009, 08:25 PM
#3
Re: Remove double String from a String
If the delimiter character changes continuously from one string to the next, then you are a dead duck because there is no consistency.
-
Aug 8th, 2009, 08:30 PM
#4
Thread Starter
Fanatic Member
Re: Remove double String from a String
 Originally Posted by Code Doc
If the delimiter character changes continuously from one string to the next, then you are a dead duck because there is no consistency. 
yes but i was studying the output and found that the other string that i wanna remove come as double are same
look in this example
Code:
brad123]slI,Z3]slI,Z3]slI,Z3]
Now the true string is : brad123
next it come a serie of 3 doube of string ]slI,Z3]..
brad123]slI,Z3]slI,Z3]slI,Z3]
1 2 3
as you see the double are the same
brad123 ]slI,Z3 ]slI,Z3 ]slI,Z3]
'true str 1 double 2 double 3 double
what do you think ?
Thanks
-
Aug 8th, 2009, 08:38 PM
#5
Re: Remove double String from a String
Killer7k said, "what do you think?"
-------------
I think that you should mark your thread Resolved using the thread tools.
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
|