Anonymous user
String comparison: Difference between revisions
→{{header|Relation}}
(Added Wren) |
|||
Line 2,830:
The generic relationship of Num '5.1' and Rat '5.1' is Same
The numeric relationship of Num '5.1' and Rat '5.1' is Same</pre>
=={{header|Relation}}==
<lang Relation>
set a = "Hello"
set b = "World"
if a == b
' a is equal to b (case sensitive)
end if
if lower(a) == lower(b)
' a is equal to b (case insensitive)
end if
if a !== b
' a is not equal to b (case sensitive)
end if
if lower(a) !== lower(b)
' a is not equal to b (case insensitive)
end if
if a << b
' a is lexically first to b (case sensitive)
end if
if lower(a) << lower(b)
' a is lexically first to b (case insensitive)
end if
if a >> b
' a is lexically after b (case sensitive)
end if
if lower(a) >> Lower(b)
' a is lexically after b (case insensitive)
end if
</lang>
Variables in Relation are not typed. They are treated as numbers of string depending on the operator. Numbers are always treated as strings, if you use the operators '''==''', '''!==''', '''<<''' and '''>>'''
=={{header|REXX}}==
|