Advertisement

05.20.2008 at 06:46AM PDT, ID: 23417104
[x]
Attachment Details

VB.net Instr and Left usage

Asked by Jimbo99999 in Microsoft Visual Basic.Net

Good Day
Experts:

I am working with VB.net and am looking for help on the most efficient way to do the following:

Filename ---> Test.sql
Username ---> Bob

I need Filename to be TestBob.sql.  

So far I have:
DotLoc = InStr(Filename, ".")
Filename = Left(Filename, DotLoc - 1)
Filename = Filename + Username + ???

But I could not figure out the best way to get the remaining characters after the Dot(.).  Here is what I came up with but it seems like there could be a better way.
Dim Length as Integer = 0
Dim Extension as String = ""
Length = Len(Filename)
Extension = Right(Filename, (Length-(DotLoc - 1))

Thanks,
jimbo99999



Start Free Trial
[+][-]05.20.2008 at 07:01AM PDT, ID: 21606201

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.20.2008 at 07:02AM PDT, ID: 21606209

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Sign Up Now!
Solution Provided By: jcoehoorn
Participating Experts: 4
Solution Grade: A
 
 
[+][-]05.20.2008 at 07:03AM PDT, ID: 21606219

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 07:11AM PDT, ID: 21606288

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628