changeset 12876:29cd5a828bb2

strtrim.m: Don't remove nuls (\0) from string. * strtrim.m: Stop removing nuls (\0) to be compatible with Matlab.
author Rik <octave@nomad.inbox5.com>
date Sat, 23 Jul 2011 19:25:03 -0700
parents 787a84da70a6
children ddea3962b024 ca5c1115b679
files scripts/strings/strtrim.m
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/strings/strtrim.m	Sat Jul 23 19:19:55 2011 -0700
+++ b/scripts/strings/strtrim.m	Sat Jul 23 19:25:03 2011 -0700
@@ -18,7 +18,7 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} strtrim (@var{s})
-## Remove leading and trailing whitespace and nulls from @var{s}.  If
+## Remove leading and trailing whitespace 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.  For example:
@@ -46,7 +46,7 @@
 
   if (ischar (s))
 
-    k = find (! isspace (s) & s != "\0");
+    k = find (! isspace (s));
     if (isempty (s) || isempty (k))
       s = "";
     else
@@ -55,7 +55,7 @@
 
   elseif (iscell(s))
 
-    s = regexprep (s, "^[\\s\v\\0]+|[\\s\v\\0]+$", '');
+    s = regexprep (s, "^[\\s\v]+|[\\s\v]+$", '');
 
   else
     error ("strtrim: S argument must be a string");