how to get the end of a string

  • Thread starter Thread starter Southern at Heart
  • Start date Start date
S

Southern at Heart

Is there an easy line of code to do this:

The string I'm looking for is everything that comes after the last space in
the string strData

thanks. SaH
 
Southern at Heart said:
Is there an easy line of code to do this:

The string I'm looking for is everything that comes after the last space
in
the string strData


Dim strData As String
Dim strLastWord As String

strData = "this is the line of data"

strLastWord = Mid$(strData, InStrRev(strData, " ") + 1)
 
Thanks, much. I knew there must be a better way than using Split() and
Ubound()...
 
Back
Top