StringReader.readQuotedString

Reads a string that may be quoted.

struct StringReader
string
readQuotedString
()

Throws

StringTerminatedException if there's nothing left to read QuotedStringNotClosedException if the string is quoted but never terminated

Examples

auto r = StringReader(`quoted "not quoted"`);
assert(r.readQuotedString() == "quoted");
assert(r.readQuotedString() == "not quoted");

// escaping is not supported
r = StringReader(`"escaped \""`);
assert(r.readQuotedString() == `escaped \`);
try {
   r.readQuotedString();
   assert(0);
} catch(QuotedStringNotTerminatedException) {}

Meta