If I input the string 2006-03894 from a file, how can I trim the string so that the result is 2006?
Thank you,
Ed
Printable View
If I input the string 2006-03894 from a file, how can I trim the string so that the result is 2006?
Thank you,
Ed
Left$() will work:
VB Code:
Debug.Print Left$("2006-03894", Instr(1, "2006-03894", "-") - 1)
so will split
DIm tmp() as string
tmp = Split("2006-03894", "-")
Msgbox tmp(0)
Bah! When will the symbols die?Quote:
Originally Posted by RhinoBull
In VB6 never! :rolleyes:
In case you never knew - there are two Left funtions: one return variant (Left) and one return string (Left$). Same for Mid/Mid$ and some others. ;)