[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Equivalent of Perl 'join' ?
From: |
Sergei Steshenko |
Subject: |
Re: Equivalent of Perl 'join' ? |
Date: |
Thu, 16 Dec 2010 10:52:23 -0800 (PST) |
--- On Thu, 12/16/10, John W. Eaton <address@hidden> wrote:
> From: John W. Eaton <address@hidden>
> Subject: Re: Equivalent of Perl 'join' ?
> To: "Ben Abbott" <address@hidden>
> Cc: "CdeMills" <address@hidden>, address@hidden
> Date: Thursday, December 16, 2010, 10:17 AM
> On 16-Dec-2010, Ben Abbott wrote:
>
> | If you'd like to preserve spaces ....
> |
> | strcat (strcat (LIST, EXPR){:})
> |
> | For example ...
> |
> | c = {"a", "b", "c"};
> | cstrcat (strcat (c, ";"){:})
> | ans = a;b;c;
>
> Another way:
>
> c = {"a", "b", "c"};
> sprintf ("%s;", c{:})
>
> jwe
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
Not quite:
"
octave:1> c = {"a", "b", "c"};
octave:2> c
c =
{
[1,1] = a
[1,2] = b
[1,3] = c
}
octave:3> sprintf ("%s;", c{:})
ans = a;b;c;
octave:4>
"
- the trailing ';' is redundant. I.e. Perl 'join' would produce
a;b;c
.
Regards,
Sergei.
- Equivalent of Perl 'join' ?, CdeMills, 2010/12/16
- Re: Equivalent of Perl 'join' ?, Ben Abbott, 2010/12/16
- Re: Equivalent of Perl 'join' ?, John W. Eaton, 2010/12/16
- Re: Equivalent of Perl 'join' ?, bpabbott, 2010/12/16
- Re: Equivalent of Perl 'join' ?, CdeMills, 2010/12/16
- Re: Equivalent of Perl 'join' ?, John W. Eaton, 2010/12/16
- Re: Equivalent of Perl 'join' ?, CdeMills, 2010/12/16