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"
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"
is this as simple as:
msgbox replace("I am here", "I", "")
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"
dim s as String
a=Split(s, vbSpace)
msgbox a(0) 'I
...
msgbox a(2) '"here"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
to output the first word,
debug.print left(strText & " ", instr(strText, " ")-1)
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.
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
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
ASKER