use str.partition for faster searching