Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

you have to use the SubString function. For example,

Dim str1, str2, str3, bigStr As String

bigStr = "Visual Basic .NET"

str1 = bigStr.SubString(0, 3)
str2 = bigStr.SubString(11)
str3 = bigStr.SubString(5,5)

 

str1 would be "Vis"

str2 would be "c .NET"

str3 would be "al Ba"

 

If you leave out the second parameter, it will just get the rest of

the string, from the character you specify. Otherwise it gets the

number of characters you specify after the first index you specify. Remember,

the params are Start and Length, not Start and End.

 

You should never use the Mid, Left and Right functions, because they

are part of the Visual Basic compatability library; something MS should

have left out, IMO.

  • *Experts*
Posted

The Microsoft.VisualBasic.whatever functions are mostly bad

programming practice. They are there so that the VB6 project migration

wizard will not fumble (the wizard itself is bad practice). You should

stay away from them. I even check functions that I am using (if I am

not sure of the library) with the Object Browser to make sure they

are not part of this library.

 

Note that not all of the functions in this library should be militantly

avoided (CodeDom uses an interface from this namespace, if I recall

correctly), but the VB6 ones should.

  • 2 weeks later...
Posted

Try This one

 

Well Dude

 

If you have used Visual Basic 6 and want to use functions in VB.NET

 

Just in project import this

 

imports Microsot.VisualBasic[code=visualbasic]

 

then in code down you can use your VB functions easily.

The one and only

Dr. Madz

eee-m@il

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...