• 0

NOOBALERT


Question

5 answers to this question

Recommended Posts

  • 0

Dim yournewstring, ab As String

ab = "Hello World!"

yournewstring = Mid(ab,5,Len(ab))

would put out this: "o World!"

Mid syntax = Mid(string, start as int, length as int)

so if you do Mid(ab,5,Len(ab)) it takes a part from ab which starts at the 5th character, and ends at the last character (= Len(ab) )

Good luck.

Buy some books on VB(.NET)

Link to comment
Share on other sites

  • 0

Since you're programming in .NET i'd advise you to make use of the methods/functions provided by the base class library, at least when you move over to C# for example you wuld be fairly confident with using it. Mid is a legacy function used in the later versions of VB (VB6 and older versions). Although i don't really think there's much of an issue of using legacy functions, most .NET enthusiasts encourage using the functions provided by the framework. So in this case i'd advise using the SubString function instead.

Check out this link for VB6 String Manipulation Equivalents in .NET:

http://www.planet-source-code.com/vb/scrip...d=169&lngWId=10

If any experienced .NET Developer reads this, if you use legacy functions in the Microsoft.VisualBasic namespace, wouldn't that force that to be imported, and like if you're using just say two functions from this namespace, wouldn't that be sort of inefficient? Just wondering.

Link to comment
Share on other sites

  • 0

Dim firstString, myNewString as String
firstString = "Hello world!"
myNewString = firstString.SubString(4)

Do not use Mid. It's a legacy VB6 function that is only there for porting issues. Use .NET stanard mehods, such as Substring. That makes moving to another language much easier.

Link to comment
Share on other sites

  • 0
If any experienced .NET Developer reads this, if you use legacy functions in the Microsoft.VisualBasic namespace, wouldn't that force that to be imported, and like if you're using just say two functions from this namespace, wouldn't that be sort of inefficient? Just wondering.

584824235[/snapback]

I'm not extremely experienced, but I don't believe importing DLL's makes the application any less efficient. I'm probably wrong though. :p

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.