BergenBman Posted January 7, 2003 Posted January 7, 2003 I can use the mid function to parse a string but when I try to use either the LEFT or Right functions to parse a string it doesn't recognize the functions Quote
*Experts* Volte Posted January 7, 2003 *Experts* Posted January 7, 2003 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. Quote
Gizmo001 Posted January 8, 2003 Posted January 8, 2003 Left and Right functions would work if you use the complete functions: Microsoft.VisualBasic.Left(String,#) or Microsoft.VisualBasic.Right(String,#) Quote
Moderators Robby Posted January 8, 2003 Moderators Posted January 8, 2003 or you can... Imports Microsoft.VisualBasic I would rather see SubString used. Quote Visit...Bassic Software
*Experts* Volte Posted January 8, 2003 *Experts* Posted January 8, 2003 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. Quote
Madz Posted January 22, 2003 Posted January 22, 2003 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. Quote The one and only Dr. Madz eee-m@il
Moderators Robby Posted January 22, 2003 Moderators Posted January 22, 2003 Dr. Madz, I guess you didn't read my post of two weeks ago (2 posts up ). Also, there is no need to use any of the VB6 functions whilst in .NET. Quote Visit...Bassic Software
Madz Posted January 22, 2003 Posted January 22, 2003 Dear Ruby I m Sorry, i am a new comer, and i dont know about any post. this is my first day here. Quote The one and only Dr. Madz eee-m@il
Moderators Robby Posted January 22, 2003 Moderators Posted January 22, 2003 Not to beat a dead horse, read my other post on this page. And it's Robby. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.