LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Fast way to truncate string

Suppose I have the following string.

Dim s as String
s = "Always eat lots of fruits and vegetables every day."

I would like to be able to truncate this string as quickly
as possible, beginning from a word of my choosing, all
the way to the end of the string.

So, if I choose the word "and" as my target word, the
above string should be transformed into:

"Always eat lots of fruits "

Essentially, all text after the first occurence of "and"
was removed from the string.

I'm looking for solution that runs quickly. Thanks!

~Rob




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TRUNCATE SPACE FROM NUMERICAL STRING eg "33 033 546" NAEEM Excel Worksheet Functions 8 December 5th 06 07:30 PM
Truncate string bwmaher Excel Programming 3 November 8th 06 07:11 PM
Truncate string bwmaher Excel Programming 0 November 8th 06 01:17 PM
How do you truncate a text string? dailygluttony Excel Worksheet Functions 2 March 28th 06 08:08 PM
Any fast method to parse a string into row & col information Nick Excel Programming 3 August 19th 04 06:47 PM


All times are GMT +1. The time now is 03:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"