octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strsplit


From: Ben Abbott
Subject: Re: strsplit
Date: Thu, 05 Jun 2014 20:00:34 -0400

On Jun 5, 2014, at 7:05 PM, Juan Pablo Carbajal <address@hidden> wrote:

> Hi,
> 
> Is the following behavior correct in strsplit?
> 
> strsplit("/usr/local/share/octave/",filesep())
> ans =
> {
>  [1,1] =
>  [1,2] = usr
>  [1,3] = local
>  [1,4] = share
>  [1,5] = octave
>  [1,6] =
> }
> 
> strsplit("/usr/local/share/octave/",filesep(),true)
> ans =
> {
>  [1,1] =
>  [1,2] = usr
>  [1,3] = local
>  [1,4] = share
>  [1,5] = octave
>  [1,6] =
> }
> 
> strsplit("/usr/local/share/octave/",filesep(),false)
> ans =
> {
>  [1,1] =
>  [1,2] = usr
>  [1,3] = local
>  [1,4] = share
>  [1,5] = octave
>  [1,6] =
> }
> 
> 
> The output puts an empty cell element when the matching delimiter is
> at the beginning and at the end.
> This causes geometry ADD_PKG script to fail, so the behavior changed
> not long ago (I remember some mails about this, ml compatibility?).

I get the same result using Matlab.

Ben




reply via email to

[Prev in Thread] Current Thread [Next in Thread]