RosettaCodeData/Task/String-comparison/WDTE/string-comparison.wdte

12 lines
578 B
WDTE

== 'example1' 'example2' -- io.writeln io.stdout; # Test for exact equality.
== 'example1' 'example2' -> ! -- io.writeln io.stdout; # Test for inequality.
< 'example1' 'example2' -- io.writeln io.stdout; # Test for lexical before.
> 'example1' 'example2' -- io.writeln io.stdout; # Test for lexical after.
# Case insensitive equality check by converting both to lowercase.
let str => import 'strings';
== (str.lower 'eXaMpLe') (str.lower 'ExAmPlE') -- io.writeln io.stdout;
# This is false. Strings are not coerced to numbers and vice-versa.
== '3' 3 -- io.writeln io.stdout;