Question Finding words within a string

leer

New member
Joined
Mar 31, 2011
Messages
3
Programming Experience
Beginner
Alright

Basically what I'm trying to achieve is to extract all the words within a piece of string and transfer that from one text box to another text box.

An example piece of the string would be

<laugh:894u8438:4434:words>

However the words within the string will never remain constant and the characters before and after will change. Is there anything that will read the string and take a word from the string without it being pre-programmed. The string it is reading from is uploaded from a text file.

Thanks for any help.
 
<laugh:894u8438:4434:words>

However the words within the string will never remain constant and the characters before and after will change.
Though is your example a reliable pattern? The patterns you displayed (except the tags) is a simple String.Split for ":" delimiter.
 
You can't change the delimiter at all? I love to use | !

<laugh:894u8438:4434:words>

Is there always three : ? You said there is always a time, so why not set your program up for that?

Dim tmp_split_txt as string = split("<laugh:894u8438:4434:words>", ":")

dim output_str as string = tmp_split_txt(1) & tmp_split_txt(2)

Maybe that will help?
 
Possibly however there won't always be a time. A main part of the functionality is meant to be any sort of string can be sliced. So ideally if there was a function that read each character and would know what sort of character it was i.e. letter, number etc then that could work as if it read it such as letter letter letter letter number, it could take those four letters away and they would be saved for the program.
 
Back
Top