Link to home
Start Free TrialLog in
Avatar of rtananthan
rtananthan

asked on

extracting a string within a string

hi,
Could any one write me code to extracta string within a string by identifying the end of the string to be extracted with a space.
eg:-"I am here"
then i have to extrac the word "I"
Avatar of rtananthan
rtananthan

ASKER

Please answer this quickly as possible
Avatar of Éric Moreau
is this as simple as:
msgbox replace("I am here", "I", "")
dim a as Array
dim s as String
a=Split(s, vbSpace)
msgbox a(0) 'I
...
msgbox a(2) '"here"

ASKER CERTIFIED SOLUTION
Avatar of Viazoom
Viazoom

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
to output the first word,

debug.print left(strText & " ", instr(strText, " ")-1)
Hi rtananthan,
This old question (QID 20568018) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

 -->Accept Viazoom's comment as Answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER

GPrentice00
Cleanup Volunteer