octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

forwarded message from Alois Schloegl


From: John W. Eaton
Subject: forwarded message from Alois Schloegl
Date: Fri, 16 Apr 2004 10:30:21 -0500

Does anyone know of something that will break if deblank is changed to
remove all trailing whitespace characters, not just blanks and NULs?

Should the change below be modified so that it continues to remove NUL
characters?  Is there some good reason for dropping that feature?

jwe


------- start of forwarded message -------
From: Alois Schloegl <address@hidden>
To: address@hidden
Subject: patch for DEBLANK
Date: Fri, 16 Apr 2004 09:34:51 -0500



The following patch enables deblank to remove all whitespace characters, 
not only NUL and blank.


Alois



*** /usr/local/share/octave/2.1.57/m/strings/deblank.m  Thu Apr  8 
17:17:32 2004
--- deblank.m   Fri Apr 16 16:25:18 2004
***************
*** 19,25 ****
 
  ## -*- texinfo -*-
  ## @deftypefn {Function File} {} deblank (@var{s})
! ## Removes the trailing blanks and nulls from the string @var{s}.
  ## If @var{s} is a matrix, @var{deblank} trims each row to the
  ## length of longest string.
  ## @end deftypefn
--- 19,25 ----
 
  ## -*- texinfo -*-
  ## @deftypefn {Function File} {} deblank (@var{s})
! ## Removes trailing whitespace characters from the string @var{s}.
  ## If @var{s} is a matrix, @var{deblank} trims each row to the
  ## length of longest string.
  ## @end deftypefn
***************
*** 35,41 ****
 
    if (isstr (s))
 
!     k = find (s != " " & s != "\0");
      if (isempty (s) || isempty (k))
        t = "";
      else
--- 35,41 ----
 
    if (isstr (s))
 
!     k = find (! isspace(s));
      if (isempty (s) || isempty (k))
        t = "";
      else
------- end of forwarded message -------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]