Alex Rivera | Logout

Left of a character in a string in vb.net

Asked 2009-09-22T16:07:32.130
27

say if I have a string 010451-09F2

How to I get left of - from the above string in vb.net

I want 010451

The left function doesn't allow me to specify seperator character.

Thanks

Edit
Report

1 Answer

0

Use something like this:

Mid("010451-09F2",1,InStr("-"))

answered 2009-09-22T16:13:41.843

Your Answer