scanString and scanUpToString