Is all this Invarient **** er... stuff, premature optimisation?
    p9e883002 at sneakemail.com 
    p9e883002 at sneakemail.com
       
    Sun Apr 27 17:44:14 PDT 2008
    
    
  
On Mon, 28 Apr 2008 02:14:19 +0200, "Simen Kjaeraas" 
<simen.kjaras at gmail.com> wrote:
> <p9e883002 at sneakemail.com> wrote:
> 
> Is this what you wanted to write?
> 
> int main(string[] args)
> {
>    char[] a =3D cast(char[])args[0];
>    a[2..5] =3D "XXX";
>    writefln(a);
>    return 0;
> }
> This compiles and runs, and seems to do what you describe. Sure, there's=
>  a
> cast there, but it's not all that bad, is it?
No. You missed out uppercasing the string before replacing the slice.
    
    
More information about the Digitalmars-d
mailing list