Substring using Boyer-Moore-Horspool method