String "dequote" in phobos?

cc cc at nevernet.com
Thu May 13 17:12:14 UTC 2021


On Thursday, 13 May 2021 at 16:40:29 UTC, Imperatorn wrote:
> Wouldn't this just this do that? 🤔
>
> ```d
> string dequote(string s)
> {
>     return s[1..$-1];
> }
> ```

The idea would be for situations where it isn't known in advance 
whether the string is quoted, if it is quoted properly, and 
whether there are escaped quotes within the string that need to 
be un-escaped.  Additionally some data sources may handle 
escaping quotes in strings differently (e.g. `\"` vs `""`)


More information about the Digitalmars-d-learn mailing list