I have a text file, that contains text with escaped characters, eg:

//----
hello\tworld.
this line\ncontains a break.
and this one a\x20binary character.
and this one\u0020an escaped unicode.
//----

The idea is that once parse line by line, I want 4 strings (1 for each line), but with the escaped characters parsed to their normal value.

I'm having trouble doing this efficiently. I can do it with std.conv.parse, but provided I preppend and append a double quote to my strings first. It's not the most efficient way to do it, but it works. It's kind of hackish though :/

I was wondering if there anything in phobos that could do this more naturally? Or in an "idiomatic" fashion?

Reply via email to