On Sunday, 18 May 2014 at 19:09:52 UTC, Chris Cain wrote:
On Sunday, 18 May 2014 at 18:55:59 UTC, Tim wrote:
Hi everyone,
is there any chance to modify a char in a string like:
As you've seen, you cannot modify immutables (string is an
immutable(char)[]). If you actually do want the string
On 05/19/2014 10:07 AM, Tim wrote:
I already tried:
void main()
{
char[] sMyText = Replace the last char_;
sMyText[$ - 1] = '.';
}
but I always getting Error: cannot implicitly convert expression
(Replace the last char_) of type string to char[].
Hi everyone,
is there any chance to modify a char in a string like:
void main()
{
string sMyText = Replace the last char_;
sMyText[$ - 1] = '.';
}
But when I execute the code above I'm always getting cannot
modify immutable expression at sMyText[__dollar -1LU]. I though
D supported
Tim:
is there any chance to modify a char in a string like:
void main()
{
string sMyText = Replace the last char_;
sMyText[$ - 1] = '.';
}
But when I execute the code above I'm always getting cannot
modify immutable expression at sMyText[__dollar -1LU]. I
though D supported such
On Sunday, 18 May 2014 at 18:55:59 UTC, Tim wrote:
Hi everyone,
is there any chance to modify a char in a string like:
As you've seen, you cannot modify immutables (string is an
immutable(char)[]). If you actually do want the string to be
modifiable, you should define it as char[] instead.