comparison scripts/strings/strchr.m @ 11587:c792872f8942

all script files: untabify and strip trailing whitespace
author John W. Eaton <jwe@octave.org>
date Thu, 20 Jan 2011 17:35:29 -0500
parents fd0a3ac60b0e
children 26d3164fd58d
comparison
equal deleted inserted replaced
11586:12df7854fa7c 11587:c792872f8942
54 mask = reshape (f(si), size (str)); 54 mask = reshape (f(si), size (str));
55 endif 55 endif
56 varargout = cell (1, nargout); 56 varargout = cell (1, nargout);
57 varargout{1} = []; 57 varargout{1} = [];
58 [varargout{:}] = find (mask, varargin{:}); 58 [varargout{:}] = find (mask, varargin{:});
59 endfunction 59 endfunction
60 60
61 %!assert(strchr("Octave is the best software",""),zeros(1,0)) 61 %!assert(strchr("Octave is the best software",""),zeros(1,0))
62 %!assert(strchr("Octave is the best software","best"),[3, 6, 9, 11, 13, 15, 16, 17, 18, 20, 23, 27]) 62 %!assert(strchr("Octave is the best software","best"),[3, 6, 9, 11, 13, 15, 16, 17, 18, 20, 23, 27])
63 %!assert(strchr("Octave is the best software","software"),[3, 4, 6, 9, 11, 13, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27]) 63 %!assert(strchr("Octave is the best software","software"),[3, 4, 6, 9, 11, 13, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27])
64 64