Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parse text between two words using vbscript 1

Status
Not open for further replies.

jasonhuibers

Programmer
Sep 12, 2005
290
CA
My string contains: The dog walked across the street.

How can I parse this string and only return walked across ..

Take only words between dog and street.
 
The words between dog and street will actually be "walked across the"

Use instr(sentence,word) to get the first split position.


Use instrrev(sentence,word) + len(word) to get the end split position.


mid(sentence,start,end)

Or you could make it into a useful "slice" function.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top