protect the original string between substring invocations