>>Not really an answer but isn't Mid() in the Microsoft.VisualBasic library and just there for VB6 compatability. Only difference I see between that and SubString() is that it won't throw an exception if the first parameter is greater than the string length. Not suggesting that Substring() will be faster (although it may be) - just that Mid() has no advantage.
>
>I heard that it is not totally the same thing. I have always used it in VB.NET. However, I read about SubString() as well. I haven't done any test on it yet.
>
>>Did you say elswhere that the 'search for' string can be 20K?
>
>Yes
>
>>If so then how long is the 'search in' string ?
>
>That would be an average of one character to 20 characters.
>
>>How likely is it that, for example, the first *half* of the 20K string would be matched ?
>
>I am not sure what you mean here.
I'm guessing that Viv means - what's the probability of the search string to be found in first 10K and not the second 10K.
If it's not broken, fix it until it is.
My Blog