Answer the question
In order to leave comments, you need to log in
How does IndexOf work in C#?
Who knows what search algorithm IndexOf works in C#? Where can I read about this or can I see the source code for the IndexOf method in C#?
Answer the question
In order to leave comments, you need to log in
For me, this is the simplest algorithm, since the lines are neither sorted nor connected in any way. In sorted / linked arrays, everything is different, I think, there, depending on the structure, the method is most likely overridden.
function indexOf(neededChar)
{
for( q = 0; q < string.length; q++ )
{
if( string[q] === neededChar )
{
return q;
}
}
return -1;
}
I think it's not so simple www.blackbeltcoder.com/Articles/algorithms/fast-text-search-with-boyer-moore
By the way the difference between
Index = Str.IndexOf(FindString, Index);
and
Index = Str.IndexOf(FindString, Index, StringComparison.Ordinal);
is really significant on a particular task as 14.20 minutes versus 8.20, and judging by the article there is already a full optimization
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question