From: <car...@us...> - 2012-01-19 16:13:21
|
Revision: 9542 http://octave.svn.sourceforge.net/octave/?rev=9542&view=rev Author: carandraug Date: 2012-01-19 16:13:10 +0000 (Thu, 19 Jan 2012) Log Message: ----------- strtrim: removed from package since it is part of core since 3.6.0 Removed Paths: ------------- trunk/octave-forge/main/strings/inst/strtrim.m Deleted: trunk/octave-forge/main/strings/inst/strtrim.m =================================================================== --- trunk/octave-forge/main/strings/inst/strtrim.m 2012-01-19 12:30:43 UTC (rev 9541) +++ trunk/octave-forge/main/strings/inst/strtrim.m 2012-01-19 16:13:10 UTC (rev 9542) @@ -1,57 +0,0 @@ -## Copyright (C) 1996 Kurt Hornik -## -## This program is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This software is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this software; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {} strtrim (@var{s}) -## Remove leading and trailing blanks and nulls from @var{s}. If @var{s} -## is a matrix, @var{strtrim} trims each row to the length of longest -## string. If @var{s} is a cell array, operate recursively on each -## element of the cell array. -## @end deftypefn - -## strtrim is based on deblank - -## Author: Kurt Hornik <Kur...@wu...> -## Adapted-By: jwe -## Adapted-By: Alexander Barth <ab...@ma...> - -function s = strtrim (s) - - if (nargin != 1) - usage ("strtrim (s)"); - endif - - if (ischar (s)) - - k = find (! isspace (s) & s != "\0"); - if (isempty (s) || isempty (k)) - s = ""; - else - k = ceil(k / rows(s)); - s = s(:,min(k):max(k)); - endif - - elseif (iscell(s)) - - for i = 1:numel (s) - s{i} = strtrim (s{i}); - endfor - - else - error ("strtrim: expecting string argument"); - endif - -endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |