Ali Ãehreli: > what is the best way of modifying that array?
In your code it's the definition too that throws an exception:
void main() {
char[100] a = "old content";
}
This works, but it's not nice:
import std.stdio;
void main() {
char[100] a;
string s1 = "old content";
a[0 .. s1.length] = s1;
writeln(a);
string s2 = "new content";
a[0 .. s2.length] = s2;
writeln(a);
a[0 .. "new content".length] = "new content";
writeln(a);
}
Bye,
bearophile
