String manipulation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
use string.IndexOf instead of InStr and string.SubString instead of Mid.
 
Craig HB said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top