Mercurial > octave-nkf
comparison scripts/strings/isstrprop.m @ 10549:95c3e38098bf
Untabify .m scripts
author | Rik <code@nomad.inbox5.com> |
---|---|
date | Fri, 23 Apr 2010 11:28:50 -0700 |
parents | eb63fbe60fab |
children | 693e22af08ae |
comparison
equal
deleted
inserted
replaced
10548:479536c5bb10 | 10549:95c3e38098bf |
---|---|
83 function retval = isstrprop (str, pred) | 83 function retval = isstrprop (str, pred) |
84 | 84 |
85 if (nargin == 2) | 85 if (nargin == 2) |
86 switch (pred) | 86 switch (pred) |
87 case "alpha" | 87 case "alpha" |
88 retval = isalpha (str); | 88 retval = isalpha (str); |
89 case {"alnum", "alphanum"} | 89 case {"alnum", "alphanum"} |
90 retval = isalnum (str); | 90 retval = isalnum (str); |
91 case "ascii" | 91 case "ascii" |
92 retval = isascii (str); | 92 retval = isascii (str); |
93 case "cntrl" | 93 case "cntrl" |
94 retval = iscntrl (str); | 94 retval = iscntrl (str); |
95 case "digit" | 95 case "digit" |
96 retval = isdigit (str); | 96 retval = isdigit (str); |
97 case {"graph", "graphic"} | 97 case {"graph", "graphic"} |
98 retval = isgraph (str); | 98 retval = isgraph (str); |
99 case "lower" | 99 case "lower" |
100 retval = islower (str); | 100 retval = islower (str); |
101 case "print" | 101 case "print" |
102 retval = isprint (str); | 102 retval = isprint (str); |
103 case "punct" | 103 case "punct" |
104 retval = ispunct (str); | 104 retval = ispunct (str); |
105 case {"space", "wspace"} | 105 case {"space", "wspace"} |
106 retval = isspace (str); | 106 retval = isspace (str); |
107 case "upper" | 107 case "upper" |
108 retval = isupper (str); | 108 retval = isupper (str); |
109 case "xdigit" | 109 case "xdigit" |
110 retval = isxdigit (str); | 110 retval = isxdigit (str); |
111 otherwise | 111 otherwise |
112 error ("isstrprop: invalid predicate"); | 112 error ("isstrprop: invalid predicate"); |
113 endswitch | 113 endswitch |
114 else | 114 else |
115 print_usage (); | 115 print_usage (); |
116 endif | 116 endif |
117 | 117 |