RosettaCodeData/Task/Empty-string/R/empty-string.r

10 lines
149 B
R

s <- ''
if (s == '') cat('Empty\n')
#or
if (nchar(s) == 0) cat('Empty\n')
if (s != '') cat('Not empty\n')
#or
if (nchar(s) > 0) cat('Not empty\n')