Mercurial > hg > octave-lyh
comparison scripts/strings/strmatch.m @ 11472:1740012184f9
Use uppercase for variable names in error() strings to match Info documentation. Only m-files done.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 09 Jan 2011 21:33:04 -0800 |
parents | c776f063fefe |
children | fd0a3ac60b0e |
comparison
equal
deleted
inserted
replaced
11471:994e2a93a8e2 | 11472:1740012184f9 |
---|---|
51 if (nargin < 2 || nargin > 3) | 51 if (nargin < 2 || nargin > 3) |
52 print_usage (); | 52 print_usage (); |
53 endif | 53 endif |
54 | 54 |
55 if (! ischar (s)) | 55 if (! ischar (s)) |
56 error ("strmatch: first argument must be a string"); | 56 error ("strmatch: S must be a string"); |
57 endif | 57 endif |
58 | 58 |
59 ## Truncate trailing whitespace. | 59 ## Truncate trailing whitespace. |
60 s = strtrimr (s); | 60 s = strtrimr (s); |
61 | 61 |
85 match &= all (AA == "\0" | AA == " ", 2); | 85 match &= all (AA == "\0" | AA == " ", 2); |
86 endif | 86 endif |
87 idx = find (match); | 87 idx = find (match); |
88 endif | 88 endif |
89 else | 89 else |
90 error ("strmatch: second argument must be a string or cell array of strings"); | 90 error ("strmatch: A must be a string or cell array of strings"); |
91 endif | 91 endif |
92 | 92 |
93 endfunction | 93 endfunction |
94 | 94 |
95 ## Removes nuls and blanks from the end of the array | 95 ## Removes nuls and blanks from the end of the array |