# HG changeset patch # User Rik # Date 1311474303 25200 # Node ID 29cd5a828bb260541fb13aec2786e246a9163130 # Parent 787a84da70a65acd37456a134af3dc745c59ea92 strtrim.m: Don't remove nuls (\0) from string. * strtrim.m: Stop removing nuls (\0) to be compatible with Matlab. diff --git a/scripts/strings/strtrim.m b/scripts/strings/strtrim.m --- a/scripts/strings/strtrim.m +++ b/scripts/strings/strtrim.m @@ -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");