Skip to content

Commit da96ef6

Browse files
committed
strempty: polymorphic
1 parent 7e52797 commit da96ef6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

+stdlib/private/strempty.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
%% STREMPTY is the char / string empty
1+
%% STREMPTY is the char | string empty
22

33
function y = strempty(s)
44

5-
y = strlength(s) == 0;
5+
if isempty(s)
6+
y = false;
7+
else
8+
y = strlength(s) == 0;
9+
end
10+
611

712
end

0 commit comments

Comments
 (0)