RosettaCodeData/Task/Empty-string/MATLAB/empty-string.m

9 lines
266 B
Mathematica
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
% Demonstrate how to assign an empty string to a variable.
str = '';
% Demonstrate how to check that a string is empty.
isempty(str)
(length(str)==0)
% Demonstrate how to check that a string is not empty.
~isempty(str)
(length(str)>0)