filesep extension

Michael Goffioul michael.goffioul at gmail.com
Wed Nov 12 04:37:48 CST 2008


On Tue, Nov 11, 2008 at 6:28 PM, Jaroslav Hajek <highegg at gmail.com> wrote:
> It seems I tried an ugly trick that wouldn't work. So here's a
> hopefully working version:
>
>  function varargout = strchr (str, chars, varargin)
>  if (nargin < 2 || ! ischar (str) || ! ischar (chars))
>   print_usage ();
>  endif
>  f = false (1, 256);
>  f(chars+1) = true;
>  varargout = cell (1, nargout);
>  varagout{1} = [];
>  [varargout{:}] = find (reshape (f(str+1), size (str)), varargin{:});
> endfunction

I like this one. Why do you need to reshape?
How about commiting?

Michael.


More information about the Octave-maintainers mailing list