Empty string: Difference between revisions

add language: Retro
(add language: Retro)
Line 318:
if s:
print('String s is not empty.')</lang>
 
=={{header|Retro}}==
Create an empty string and assign it to a variable. In these '''keepString''' is used to ensure that the string is permanent.
 
<lang Retro>
( by creating a variable )
"" keepString variable: foo
 
( by setting an existing variable 'foo' )
"" keepString !foo
</lang>
 
Checking that a string is empty. A string with a length of zero is assumed to be empty.
 
<lang Retro>
: emtpy? ( $-f ) getLength 0 = ;
 
"" empty? putn
"hello" empty? putn
</lang>
 
Check that a string is not empty.
 
<lang Retro>
: notEmpty? ( $-f ) getLength 0 > ;
 
"" notEmpty? putn
"hello" notEmpty? putn
</lang>
 
=={{header|Ruby}}==
Anonymous user