isstr

Obsolete test for character arrays; use ischar instead.

Category: Language Fundamentals > Data Types

Syntax

tf = isstr(A)

Returns true if A is a character array.

Description

isstr predates the string class and behaves like ischar: it is true for character vectors and arrays, and false for string objects, numbers and cell arrays. New code should call ischar, or isstring when string objects are meant.

Input arguments

A
Any value.

Output arguments

tf
Logical scalar.

Example

Characters versus strings

isstr('abc')
isstr("abc")
isstr(65)
Output
ans = logical
   1
ans = logical
   0
ans = logical
   0

See also

ischar isstring iscellstr char