DotNet equivlant of vb 6 instr

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian

    DotNet equivlant of vb 6 instr

    what is the equivlant of the vb 6 instr

    I have a string there has "*D*N"
    I want to find the position that the D is in with a dotnet (VB) function


  • Martin H.

    #2
    Re: DotNet equivlant of vb 6 instr

    Hi Brian,

    You might not believe it, but you can use InStr ;-)

    Strings.InStr

    If you want to go the .NET way, then you might want to use Strings.IndexOf .

    Please note that like in VB6, InStr is 1-based while IndexOf is 0-based.

    Best regards,

    Martin

    Am 30.03.2008 11:22, Brian schrieb:
    what is the equivlant of the vb 6 instr
    >
    I have a string there has "*D*N"
    I want to find the position that the D is in with a dotnet (VB) function
    >
    >

    Comment

    • Steve Gerrard

      #3
      Re: DotNet equivlant of vb 6 instr

      Brian wrote:
      I once heard that those VB methods would be removed in future
      versions of vb.net. I am using VB.2005 and have not seen vb2008. Do
      you know if what I heard is true, or just a rumour?
      Brian
      >
      That's FUD.

      As Michel said, the msvb namespace is part of the framework. That means it is
      there forever in 2.0, 3.0, and 3.5. If some future version of the framework
      drops them, just stick to the versions that already have it. ;-)


      Comment

      • Tom Shelton

        #4
        Re: DotNet equivlant of vb 6 instr

        On Mar 30, 7:42 am, "Brian" <bsgalla...@com munity.nospamwr ote:
        I once heard that those VB methods would be removed in future versions of
        vb.net.  I am using VB.2005 and have not seen vb2008.  Do you know if what I
        heard is true, or just a rumour?
            Brian
        >
        It's confusion. Microsoft.Visua lBasic will always be there. It's
        what makes VB.NET, well, VB.NET. What is likely to be removed at some
        point (and probably not in the immediate future) is
        Microsoft.Visua lBasic.Compatab ility - which is the library used to
        contains some of the deprecated VB methods to VB.NET

        --
        Tom Shelton

        Comment

        • Herfried K. Wagner [MVP]

          #5
          Re: DotNet equivlant of vb 6 instr

          "Brian" <bsgallatin@com munity.nospamsc hrieb:
          >I once heard that those VB methods would be removed in future versions of
          >vb.net. I am using VB.2005 and have not seen vb2008. Do you know if what
          >I heard is true, or just a rumour?
          Nonsense. They are part of Visual Basic and they have even survived the
          transition from VB6 to VB.NET, so there is no reason for removing them. In
          addition, they are well-tested code.

          --
          M S Herfried K. Wagner
          M V P <URL:http://dotnet.mvps.org/>
          V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

          Comment

          • Patrice

            #6
            Re: DotNet equivlant of vb 6 instr

            Perhaps a misunderstandin g. I never seen that so this is what I would called
            a rumour... It's true though that some of the VB specific helpers are not
            included in the compact framework...

            So if plan to target the compact framework, it could make sense to avoid
            using some of those VB specifics features....

            --
            Patrice

            "Brian" <bsgallatin@com munity.nospama écrit dans le message de news:
            OS$YXvmkIHA.412 0@TK2MSFTNGP06. phx.gbl...
            >I once heard that those VB methods would be removed in future versions of
            >vb.net. I am using VB.2005 and have not seen vb2008. Do you know if what
            >I heard is true, or just a rumour?
            Brian

            Comment

            • Michael D. Ober

              #7
              Re: DotNet equivlant of vb 6 instr

              "Patrice" <http://www.chez.com/scribe/wrote in message
              news:ur7J20xkIH A.748@TK2MSFTNG P04.phx.gbl...
              Perhaps a misunderstandin g. I never seen that so this is what I would
              called a rumour... It's true though that some of the VB specific helpers
              are not included in the compact framework...
              >
              So if plan to target the compact framework, it could make sense to avoid
              using some of those VB specifics features....
              >
              --
              Patrice
              >
              "Brian" <bsgallatin@com munity.nospama écrit dans le message de news:
              OS$YXvmkIHA.412 0@TK2MSFTNGP06. phx.gbl...
              >>I once heard that those VB methods would be removed in future versions of
              >>vb.net. I am using VB.2005 and have not seen vb2008. Do you know if what
              >>I heard is true, or just a rumour?
              > Brian
              >
              Take a look in the help files. They tell you which parts of the language
              are included in the compact framework.

              Mike.


              Comment

              Working...