On 06/20/2010 07:01 AM, Ben Hanson wrote:
== Quote from Justin Spahr-Summers ([email protected])'s
"string" is actually an alias for "immutable(char)[]" (and
similarly for
the other string types), so its contents are not modifiable, though
its
length can be adjusted and contents appended. If you need to be
able to
modify the characters, just use char[] instead. You can then use the
.idup property to get a string afterward.
I'm converted temp_ to CharT[] as suggested, but the conversion back
to a string is failing:
_charset = temp_.idup;
main.d(76): Error: cannot implicitly convert expression (_adDupT((&
D58TypeInfo_AT4main14__T5regexTAyaZ18basic_string_token5CharT6__initZ),cast
(string)temp_)) of type immutable(CharT)[] to string
import std.conv;
...
_charset = to!(typeof(_charset))(temp_);
"to" converts strings of any width and mutability to strings of any
width and mutability.
Andrei