Jump to content

Empty string: Difference between revisions

no edit summary
(Added Axe)
No edit summary
Line 878:
if x.len > 0:
echo "not empty"</lang>
 
=={{header|oberon-2}}==
{{works with|oo2c version 2}}
<lang oberon2>
MODULE EmptyString;
IMPORT Out;
VAR
str: ARRAY 64 OF CHAR;
BEGIN
str := "";
Out.String("for str := ");Out.Char('"');Out.Char('"');Out.Char(';');Out.Ln;
Out.String("checking str = ");Out.Char('"');Out.Char('"');Out.String(" Is Empty? ");Out.Bool(str = "");Out.Ln;
Out.String("checking str[0] = 0X. Is Empty? ");Out.Bool(str[0] = 0X);Out.Ln;
str := "Hello Rossetta";
Out.String("for str :=");Out.Char('"');Out.String(str);Out.Char('"');Out.Char(";");Out.Ln;
Out.String("checking str = ");Out.Char('"');Out.Char('"');Out.String(" Is Empty? ");Out.Bool(str = "");Out.Ln;
Out.String("checking str[0] = 0X. Is Empty? ");Out.Bool(str[0] = 0X);Out.Ln;
END EmptyString.
</lang>
{{out}}
<pre>
for str := "";
checking str = "" Is Empty? TRUE
checking str[0] = 0X. Is Empty? TRUE
for str :="Hello Rossetta";
checking str = "" Is Empty? FALSE
checking str[0] = 0X. Is Empty? FALSE
</pre>
 
=={{header|Objeck}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.