Empty string: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 561: Line 561:
if (nchar(s) > 0) cat('Not empty\n')</lang>
if (nchar(s) > 0) cat('Not empty\n')</lang>


=={{header|Rascal}}==
<lang rascal>str s = "";
if (s=="") print("string s is empty");
if (s!="") print("string s is not empty");
</lang>
Or the build-in operator:
<lang rascal>import String;
isEmpty(s);</lang>
=={{header|Retro}}==
=={{header|Retro}}==
Create an empty string and assign it to a variable. In these '''keepString''' is used to ensure that the string is permanent.
Create an empty string and assign it to a variable. In these '''keepString''' is used to ensure that the string is permanent.