Mercurial > hg > octave-nkf
comparison scripts/strings/substr.m @ 6046:34f96dd5441b
[project @ 2006-10-10 16:10:25 by jwe]
author | jwe |
---|---|
date | Tue, 10 Oct 2006 16:10:31 +0000 |
parents | ec8c33dcd1bf |
children | a5c64dad5b93 |
comparison
equal
deleted
inserted
replaced
6045:421d8a903df7 | 6046:34f96dd5441b |
---|---|
43 ## Adapted-By: jwe | 43 ## Adapted-By: jwe |
44 | 44 |
45 function t = substr (s, offset, len) | 45 function t = substr (s, offset, len) |
46 | 46 |
47 if (nargin < 2 || nargin > 3) | 47 if (nargin < 2 || nargin > 3) |
48 usage ("substr (s, offset, len)"); | 48 print_usage (); |
49 endif | 49 endif |
50 | 50 |
51 if (ischar (s)) | 51 if (ischar (s)) |
52 nc = columns (s); | 52 nc = columns (s); |
53 if (abs (offset) > 0 && abs (offset) <= nc) | 53 if (abs (offset) > 0 && abs (offset) <= nc) |