[RESOLVED] Extracting certain information
Hey there guys, hit another problem. I was bussy on a program and I just felt curious, if in a text box for example. I want to block out certain words, EG.
Before: john is a good boy
After: john boy
So in this example "is a good" is taken out. So if there is one label...
Label1 with string "yesterday=45 today.harry" (Reading from file). I want to only see "today.harry". I hope you guys can help, thanks...
Cool :thumb:
Re: Extracting certain information
well it depends, does it follow a pattern? like is there always a space like that?
replace Data with the name of the variable that has your data in it
VB Code:
Label1.caption = mid(Data,instr(Data," "),len(Data))
Re: Extracting certain information
Thanks for the response, but that isn't what I am looking for.
I am looking for code so that the program will clear out some words and leave the rest.
Example 1:
"hapy=elen/john3432.long"
Now, I want to take out "hapy=elen/" and leave "john3432". Keep in mind that
"john3432" is a random word, so i must just clear out the first few letters, if that is possible. So in other words I am making "hapy=elen/" restriction so that it cannot be put into the text box.
Example 2:
Label1.caption = "hapy=elen/john3432.long"
After the command button has been pressed label must be....
label2.caption = "john3432.long"
I Really hope you can help with this, thanks..
Re: Extracting certain information
VB Code:
Dim strMyString As String
Dim arrMyString() As String
strMyString = "hapy=elen/john3432.long"
arrMyString = Split(strMyString,"/")
Label1.Caption = arrMyString(1)
Re: Extracting certain information
Hey there Hack, thanks alot. That worked... I just changed the code a bit but couldn't of done it with out you, thanks.
Cool
Re: Extracting certain information
Quote:
Originally Posted by spike_hacker_inc
Hey there Hack, thanks alot. That worked... I just changed the code a bit but couldn't of done it with out you, thanks.
Cool
Posted code examples almost always have to be tweaked to fit the specific needs of the posting member, so that is not unusual at all. :)
If you consider this resolved, would you please pull down the Thread Tools menu and click the Mark Thread Resolved menu item? That will let everyone know that you have your answer.
Thank you. :)