I am using Microsoft.VisualBasic.Strings.InStr() and
Microsoft.VisualBasic.Strings.Mid() to manipulate strings.

Is there a better way ? i.e. by using the framework.

Thanks,
Craig

Re: String manipulation by Mattias

Mattias
Fri Jun 03 06:59:48 CDT 2005


>Is there a better way ? i.e. by using the framework.

I'm not saying they are better, but you can use the String.IndexOf and
String.Substring methods.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Re: String manipulation by cody

cody
Fri Jun 03 07:11:41 CDT 2005

use string.IndexOf instead of InStr and string.SubString instead of Mid.


"Craig HB" <CraigHB@discussions.microsoft.com> schrieb im Newsbeitrag
news:3C1A8292-7FED-4E51-823A-789EDCD3AB71@microsoft.com...
> I am using Microsoft.VisualBasic.Strings.InStr() and
> Microsoft.VisualBasic.Strings.Mid() to manipulate strings.
>
> Is there a better way ? i.e. by using the framework.
>
> Thanks,
> Craig
>



Re: String manipulation by Jon

Jon
Fri Jun 03 14:00:46 CDT 2005

Craig HB <CraigHB@discussions.microsoft.com> wrote:
> I am using Microsoft.VisualBasic.Strings.InStr() and
> Microsoft.VisualBasic.Strings.Mid() to manipulate strings.
>
> Is there a better way ? i.e. by using the framework.

Yes - using the methods of the String class will make your code far
more idiomatically .NET, rather than looking more like classic VB. You
*may* gain some performance, but more importantly your code will be
more readable to people from other .NET languages.

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too