Jump to content

String comparison: Difference between revisions

m
(add RPL)
Line 1,958:
 
=={{header|EasyLang}}==
a$ = "hello"
EasyLang only has operators for testing the equality and inequality of strings.
if a$ = "hello"
<syntaxhighlight lang="easylang">
print "equal"
stringA$ = "String"
stringB$ = "string"
stringC$ = "string"
if stringB$ = stringC$
print "\"" & stringB$ & "\" is equal to \"" & stringC$ & "\""
.
if stringAa$ <> stringB$"hello2"
print "\"" & stringA$ & "\" is not equal to \"" & stringB$ & "\""
.
if strcmp a$ "hello" = 0
print "equal"
.
if strcmp a$ "world" < 0
print "lexically before"
.
if number "10" > number "2"
print "numerically after"
.
</syntaxhighlight>
{{out}}
<pre>
"string" is equal to "string"
"String" is not equal to "string"
</pre>
 
=={{header|Elena}}==
2,063

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.