Jump to content

Empty string: Difference between revisions

m
→‎{{header|REXX}}: remove some blank lines. -- ~~~~
No edit summary
m (→‎{{header|REXX}}: remove some blank lines. -- ~~~~)
Line 599:
 
=={{header|REXX}}==
<lang rexx>/*how to assign empty string, & then check for empty/not-empty strings.*/
<lang rexx>
/*how to assign empty string, & then check for empty/not-empty strings.*/
 
 
/*─────────────── 3 simple wats to assign an empty string to a variable.*/
Line 607 ⟶ 605:
ide="" /*uses two quotes, sometimes called a double quote.*/
doe= /*... nothing at all. */
 
 
/*─────────────── assigning multiple null values to vars, 2 methods are:*/
Line 617 ⟶ 614:
parse value 0 with . ant ape ant imp fly tui paa elo dab cub bat ayu
/*where the value of zero is skipped, the rest set to null.*/
 
 
/*─────────────── how to check that a string is empty, several methods: */
 
if cat=='' then say "the feline is not here."
if pig=="" then say 'no ham today'
Line 629 ⟶ 624:
nit='' /*assign an empty string to a lice egg.*/
if cow==nit then say 'the cow has no milk today.'
 
 
 
/*─────────────── how to check that a string isn't empty, several ways: */
 
if dog\=='' then say "the dogs are out!"
/*most REXXes support the "not" character.*/
Line 644 ⟶ 636:
if length(cod)\=0 then fish=cod /*not-so-fast compare.*/
 
/*────────────────────────── anyway, as they say. "choose your poison." */</lang>
 
/*────────────────────────── anyway, as they say. "choose your poison." */
</lang>
 
=={{header|Ruby}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.