Finding the last space in a string

houseofturner

Registered User.
Local time
Today, 08:13
Joined
Dec 10, 2009
Messages
37
I need to strip out everything before the last space in a string. I can use the Instr function to find the position of the first space but cant work out how to use it to find the position of the last space?

So if I have the text "This is what I want" the query should return "want"

Any ideas???
 
Here's a function that would return it.
Code:
Function RetLast(strInput As String) As String
   RetLast = Right(strInput, Len(strInput) - InStrRev(strInput, " "))
End Function
 

Users who are viewing this thread

Back
Top Bottom