[thelist] CF Question: Permutation of right(string, count)

rudy r937 at interlog.com
Mon Jan 8 17:57:26 CST 2001


> I would like to retrieve only the characters to the right of a comma.
> For example, if my string is "foo,bar" I'd like to retrieve "bar" only.

hi minh lee

use FindNoCase or Find to find the first comma, then use the index that
Find gives you as the start position for Mid to grab the rest of the string
from there -- but Mid needs to know how much to grab, so you have to do
some math

  Lgth = Len(yourField)
  Indx = Find(yourField, ",")
  Rslt = Mid(yourField, Indx, Lgth-Indx)

or, all in one line,

  Rslt = Mid(yourField, Find(yourField,","),
                              Len(yourField)-Find(yourField,","))

i guess instead of Mid you could also use Right in a similar way as you
were trying to do


rudy.ca







More information about the thelist mailing list