Mercurial > hg > octave-lyh
comparison scripts/strings/strsplit.m @ 12915:9e1b9ca119eb
strsplit.m: Allow any scalar input for strip_empty option,
not just logical value.
* strsplit.m: Allow any scalar input for strip_empty option,
not just logical value.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 03 Aug 2011 15:38:59 -0700 |
parents | c792872f8942 |
children | 46e68badedb8 |
comparison
equal
deleted
inserted
replaced
12914:ac00ae83ea2e | 12915:9e1b9ca119eb |
---|---|
26 ## @end deftypefn | 26 ## @end deftypefn |
27 | 27 |
28 function s = strsplit (p, sep, strip_empty = false) | 28 function s = strsplit (p, sep, strip_empty = false) |
29 | 29 |
30 if (nargin < 2 || nargin > 3 || ! ischar (p) || rows (p) > 1 | 30 if (nargin < 2 || nargin > 3 || ! ischar (p) || rows (p) > 1 |
31 || ! ischar (sep) || ! islogical (strip_empty)) | 31 || ! ischar (sep) || ! isscalar (strip_empty)) |
32 print_usage (); | 32 print_usage (); |
33 endif | 33 endif |
34 | 34 |
35 if (isempty (p)) | 35 if (isempty (p)) |
36 s = cell (size (p)); | 36 s = cell (size (p)); |