String comparison: Difference between revisions

Content added Content deleted
(add RPL)
Line 1,958: Line 1,958:


=={{header|EasyLang}}==
=={{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 stringA$ <> stringB$
if a$ <> "hello2"
print "\"" & stringA$ & "\" is not equal to \"" & stringB$ & "\""
print "not equal"
.
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}}==
=={{header|Elena}}==