Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2005

Tip: Looking for answers? Try searching our database.

Get, then delete, parts of longer string

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed - 18 Apr 2005 23:46 GMT
I have collected items and set them into a long string stored in a document,
with each item set off inside "<" and ">".  So a final string might look
like <item 1><item 2><item 3>.

I know how to use InStr(string) to find the first ">".  I was going to use
Mid to get the string from 2 (since I don't want the first "<") to InStr -
1, but Mid Help says it doesn't get the string - it replaces it.  That's
fine - I will want to replace it with noting to delete it.  But I need to
get it out of the long string first.

What do I use in between InStr and Mid?  Or is there a better way?

Ed
Klaus Linke - 19 Apr 2005 01:10 GMT
Hi Ed,

There's both a Mid method and a Mid function. You looked at the help for the Mid method, but need the Mid function.

You can locate both the position of the next "<" and ">" with InStr, and then get the string using the Mid function (starting at the position of the "<", length equals the difference between both positions).

Regards,
Klaus

> I have collected items and set them into a long string stored in a document,
> with each item set off inside "<" and ">".  So a final string might look
[quoted text clipped - 9 lines]
>
> Ed
Ed - 19 Apr 2005 13:59 GMT
That's it, Klaus!  Thank you!
Ed

Hi Ed,

There's both a Mid method and a Mid function. You looked at the help for the
Mid method, but need the Mid function.

You can locate both the position of the next "<" and ">" with InStr, and
then get the string using the Mid function (starting at the position of the
"<", length equals the difference between both positions).

Regards,
Klaus

"Ed" <ed_millis@NO_SPAM.yahoo.com> wrote:
> I have collected items and set them into a long string stored in a document,
> with each item set off inside "<" and ">".  So a final string might look
[quoted text clipped - 9 lines]
>
> Ed
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.