Mercurial > hg > octave-nkf
diff scripts/strings/strrep.m @ 2325:b5568c31ee2c
[project @ 1996-07-15 22:20:21 by jwe]
author | jwe |
---|---|
date | Mon, 15 Jul 1996 22:20:21 +0000 |
parents | 5ca126254d15 |
children | c17387059fd3 |
line wrap: on
line diff
--- a/scripts/strings/strrep.m +++ b/scripts/strings/strrep.m @@ -1,5 +1,5 @@ ## Copyright (C) 1995, 1996 Kurt Hornik -## +## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it @@ -27,20 +27,20 @@ ## Adapted-By: jwe function t = strrep (s, x, y) - + if (nargin <> 3) usage ("strrep (s, x, y)"); endif - + if (! (isstr (s) && isstr (x) && isstr (y))) error ("strrep: all arguments must be strings"); endif - + if (length (x) > length (s) || isempty (x)) t = s; return; endif - + ind = findstr (s, x, 0); len = length (ind); if (len == 0) @@ -61,5 +61,5 @@ t = [t, tmp]; t = setstr (t); endif - + endfunction