John Kincaid
asked on
How to parse space delimited string.
I need to capture all text to the right of the last space and everything (including spaces) to the left of the last space. I have been all over the Mid, Right and Left functions. All messed up here!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
EXPERT CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Anders
MyString = "Aaron Guzman"
Mid(YourString, Len(YourString)) returned "n"
and
Left(YourString, InStrRev(YourString, "")) returned "Aaron Guzman"
MyString = "Aaron Guzman"
Mid(YourString, Len(YourString)) returned "n"
and
Left(YourString, InStrRev(YourString, "")) returned "Aaron Guzman"
In addition to Bill's correct solution, you can also use the Left() function:
Left([Text1],InStrRev([Text1]," ")-1) AS LeftPart
ASKER
Anders, forgive me I am wrong, your code worked fine.
Bill, yours did as well.
Thanks to both of you!
Bill, yours did as well.
Thanks to both of you!
ASKER
Thanks again to everyone!
Welcome.
»bp
»bp
Your welcome :)
Open in new window
This will convert your text to an array splitted on each spacee.g.
YourText = "A Simple Test"
AllText(0) = "A"
AllText(1) = "Simple"
AllText(2) = "Test