Scan from string instead of file.