[dba-VB] Parsing strings

Gustav Brock Gustav at cactus.dk
Fri Apr 11 12:42:18 CDT 2008


Hi John

Why not use the Path class:

  extension = Path.GetExtension(FileName)
  basename = Path.GetFileNameWithoutExtension(FileName)

/gustav

>>> jwcolby at colbyconsulting.com 11-04-2008 19:26 >>>
I am trying to parse a string.  I notice that the string object has many 
methods but it does not seem to have the left, mid and right functions 
that vba has.

If I want to split a file name into name and extension how would you do 
it?  I am just use the existing string functions that we all know and 
love but am wondering if there is a better (.Net) way.

Thanks,
-- 
John W. Colby
www.ColbyConsulting.com 






More information about the dba-VB mailing list