String searching algorithms in C#