time | Calls | line |
---|
| | 1 | function tf = isStringScalar(s)
|
| | 2 | %isStringScalar Determine whether input is a string array with one element
|
| | 3 | % isStringScalar(S) returns 1 (true) if S is a string scalar and 0
|
| | 4 | % (false) otherwise. This is equivalent to:
|
| | 5 | %
|
| | 6 | % isstring(S) && isscalar(S)
|
| | 7 | %
|
| | 8 | % Examples:
|
| | 9 | % isStringScalar("Smith") % returns 1
|
| | 10 | %
|
| | 11 | % isStringScalar('Mary Jones') % returns 0
|
| | 12 | %
|
| | 13 | % isStringScalar(["Smith","Burns","Jones"]) % returns 0
|
| | 14 | %
|
| | 15 | % See also STRING, ISSTRING, ISSCALAR, ISCHAR, ISCELLSTR,
|
| | 16 | % convertCharsToStrings, convertStringsToChars.
|
| | 17 |
|
| | 18 | % Copyright 2017 The MathWorks, Inc.
|
| | 19 | %#codegen
|
| | 20 |
|
< 0.001 | 62 | 21 | narginchk(1,1);
|
| | 22 |
|
< 0.001 | 62 | 23 | tf = isstring(s) && isscalar(s);
|
| | 24 |
|
< 0.001 | 62 | 25 | end
|
Other subfunctions in this file are not included in this listing.