If you're convinced that the facilities in your runtime system (which offer string-in-string search and the like) are not fast enough for your application, try implementing the KMP algorithm.
But, the implementers of modern runtime systems probably have already done this for you.