Discussion Locked

Split String in VB .net ?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi..I have the following string :-
E:\VB.NET PROJECTS\ERP\bin\

I want to get the path :-
E:\VB.NET PROJECTS\ERP\

How this is possible..How to remove "\bin" from my string ?
Pl. guide..

5 replies

by tony hopkinson

Left$ or Mid$ should do it if its always going to be
E:\VB.NET PROJECTS\ERP\ at the start
If this could vary then look up INSTR which will give the start position of one string wihin another.
For instance if you were always going to strip off everything after and including \bin you'd use INSTR to find where \bin was and the LEFT$ to return all characters up to that poistion - 1.

by dr dij

This is a pretty basic VB string function.
You might want to read the manual, or online help.

by dr dij

To do this, install MSDN to get the VB help files.
YOu can start by searching for 'string' and you'll find the string functions (assuming you hadn't been told the 1st answer), then look for one that does what you want.

You can also look at ref books but online is better as you can search for what you want.

if you have $400/yr you can get subs to online books including dozens of VB and other tech books.

This discussion is closed to new replies.