?
Solved

better than instr method

Posted on 2007-04-09
1
Medium Priority
?
246 Views
Last Modified: 2013-11-06
I'm using instr to find x and ys in a string. For instance,


if instr(strString,"(4,3)") > 0 then
msgbox "its herE"
end if

Only I'm doing this with many values and its slow. Is there a faster method? If so please demonstrate
0
Comment
Question by:JPERKS1985
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
igor_alpha earned 2000 total points
ID: 18886170
Hi, JPERKS1985
Otherr methods in .net such as instr is a:
1. String.IndexOf
if strString.IndexOf("(4,3)") > 0 then
msgbox "its herE"
end if

and
2. String.Contains
if strString.Contains("(4,3)") then
msgbox "its herE"
end if

Also following opinion exists:
Instr is faster than indexOf when it is about strings.
Instr is slower than indexOf when it is about characters.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question