By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,676 Members | 1,300 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,676 IT Pros & Developers. It's quick & easy.

Problem with IndexOf

P: n/a
I'm having a problem with IndexOf on a large string. The string contains an
ASCII file which is about 45K. IndexOf is not finding substrings that I
know are in the string. Yes, I double-checked my typing. I'm also able to
locate the strings using a text editor. One substring is about 38K
characters into the string.

Is there any know issues, limitations, etc. with IndexOf that I may not be
aware of?

I'm working with a VB.Net using Visual Studio .Net 2003.

Richard Rosenheim
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Richard L Rosenheim" <ri*****@rlr.com> schrieb
I'm having a problem with IndexOf on a large string. The string
contains an ASCII file which is about 45K. IndexOf is not finding
substrings that I know are in the string. Yes, I double-checked my
typing. I'm also able to locate the strings using a text editor.
One substring is about 38K characters into the string.

Is there any know issues, limitations, etc. with IndexOf that I may
not be aware of?

I'm working with a VB.Net using Visual Studio .Net 2003.


I'd write a loop searching for a smaller substring:

dim i as integer

for i = 1 to substring.length
if FullString.indexof(substring.substring(0, i)) = -1 then
msgbox(i)
exit for
end if
next

This way you can find out at which location the string doesn't match.

Note that indexof is case sensitive.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.