Solved

better than instr method

Posted on 2007-04-09
1
241 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
1 Comment
 
LVL 15

Accepted Solution

by:
igor_alpha earned 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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. …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

839 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