I have a program that uses string double quotes, but copies from wstring double quotes. The wstring double quotes are in string type (sourceTxt is a string with wstring double quotes).

The following code crashes with an array.d(2211): Range violation error:

import std.conv : to;
import std.string : replace;

auto sourceTxtW = sourceTxt.to!wstring;
sourceTxtW.replace("”", `"`);
auto sourceTxtR = sourceTxtW.to!string;
sourceLines = sourceTxtR.split("\n");

Reply via email to