PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET DotNet equivlant of vb 6 instr

Reply

DotNet equivlant of vb 6 instr

 
Thread Tools Rate Thread
Old 30-03-2008, 04:22 AM   #1
Brian
Guest
 
Posts: n/a
Default 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


  Reply With Quote
Old 30-03-2008, 04:29 AM   #2
Martin H.
Guest
 
Posts: n/a
Default 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
>
>

  Reply With Quote
Old 30-03-2008, 09:53 AM   #3
Michel Posseth [MCP]
Guest
 
Posts: n/a
Default Re: DotNet equivlant of vb 6 instr

<< > If you want to go the .NET way

http://msdn2.microsoft.com/en-us/li...ings.instr.aspx

As you see this method is part of the VB.Net syntax , so i guess you would
bether refrace that comment as
if you want to abandon the VB namespace .

if you want to do this
http://www.codeproject.com/KB/vb/novbruntimeref.aspx ( see my comments on
Rafael for further detail )

Then it might be bether to use only the comonly shared framework classes
although , there is nothing that keeps a C# , J# , etc etc etc ( other
framework languages ) from setting a reference to the microsoft visual basic
dll and use the handy VB methods , note that this dll is NOT for backwords
compatibility !! but contains specific VB methods ( shortcuts , behaviors ,
Contstants ) that are part of the VB namespace and in it`s turn is part
of the Framework


Michel


"Martin H." <hkshk@gmx.net> schreef in bericht news:47ef0920$1@127.0.0.1...
> 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
>>


  Reply With Quote
Old 30-03-2008, 02:42 PM   #4
Brian
Guest
 
Posts: n/a
Default Re: DotNet equivlant of vb 6 instr

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

"Michel Posseth [MCP]" <MSDN@posseth.com> wrote in message
news:OyvN6NkkIHA.4684@TK2MSFTNGP06.phx.gbl...
> << > If you want to go the .NET way
>
> http://msdn2.microsoft.com/en-us/li...ings.instr.aspx
>
> As you see this method is part of the VB.Net syntax , so i guess you would
> bether refrace that comment as
> if you want to abandon the VB namespace .
>
> if you want to do this
> http://www.codeproject.com/KB/vb/novbruntimeref.aspx ( see my comments
> on Rafael for further detail )
>
> Then it might be bether to use only the comonly shared framework classes
> although , there is nothing that keeps a C# , J# , etc etc etc ( other
> framework languages ) from setting a reference to the microsoft visual
> basic dll and use the handy VB methods , note that this dll is NOT for
> backwords compatibility !! but contains specific VB methods ( shortcuts ,
> behaviors , Contstants ) that are part of the VB namespace and in it`s
> turn is part of the Framework
>
>
> Michel
>
>
> "Martin H." <hkshk@gmx.net> schreef in bericht
> news:47ef0920$1@127.0.0.1...
>> 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
>>>

>



  Reply With Quote
Old 30-03-2008, 03:14 PM   #5
Michel Posseth [MCP]
Guest
 
Posts: n/a
Default Re: DotNet equivlant of vb 6 instr

>I once heard that those VB methods would be removed in future versions of
>vb.net.


Well in VB.Net 2008 they are still there , and i personally can`t
inmagine that they would be removed unless MS would fase out VB wich is not
likely to happen


HTH

Michel


"Brian" <bsgallatin@community.nospam> schreef in bericht
news:OS$YXvmkIHA.4120@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
>
> "Michel Posseth [MCP]" <MSDN@posseth.com> wrote in message
> news:OyvN6NkkIHA.4684@TK2MSFTNGP06.phx.gbl...
>> << > If you want to go the .NET way
>>
>> http://msdn2.microsoft.com/en-us/li...ings.instr.aspx
>>
>> As you see this method is part of the VB.Net syntax , so i guess you
>> would bether refrace that comment as
>> if you want to abandon the VB namespace .
>>
>> if you want to do this
>> http://www.codeproject.com/KB/vb/novbruntimeref.aspx ( see my comments
>> on Rafael for further detail )
>>
>> Then it might be bether to use only the comonly shared framework classes
>> although , there is nothing that keeps a C# , J# , etc etc etc ( other
>> framework languages ) from setting a reference to the microsoft visual
>> basic dll and use the handy VB methods , note that this dll is NOT for
>> backwords compatibility !! but contains specific VB methods ( shortcuts ,
>> behaviors , Contstants ) that are part of the VB namespace and in it`s
>> turn is part of the Framework
>>
>>
>> Michel
>>
>>
>> "Martin H." <hkshk@gmx.net> schreef in bericht
>> news:47ef0920$1@127.0.0.1...
>>> 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
>>>>

>>

>
>



  Reply With Quote
Old 30-03-2008, 05:43 PM   #6
Tom Shelton
Guest
 
Posts: n/a
Default Re: DotNet equivlant of vb 6 instr

On Mar 30, 7:42*am, "Brian" <bsgalla...@community.nospam> 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
>


It's confusion. Microsoft.VisualBasic 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.VisualBasic.Compatability - which is the library used to
contains some of the deprecated VB methods to VB.NET

--
Tom Shelton
  Reply With Quote
Old 30-03-2008, 08:03 PM   #7
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: DotNet equivlant of vb 6 instr

"Brian" <bsgallatin@community.nospam> schrieb:
>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/>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off