INSTR in DOTNET

  • Thread starter Thread starter Guest
  • Start date Start date
Trying to find the susbstitute of INSTR function in c#.Net.

The string type has these two methods. Since they are part of the string
type, you can use them in C#, VB.Net, J# etc... :

indexOf() // works like VB instr()
lastIndexOf() // works like VB instrrev()
 
If you are using VB.NET, the "crutches" are still there in compatibility. To
find an instance, you can use IndexOf() and lastIndexOf() or resort to
regular expressions, which are the better way to go (consider Matches() to
find all instances of a specific string.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
 

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