Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/String-comparison/WDTE/string-comparison.wdte
Normal file
11
Task/String-comparison/WDTE/string-comparison.wdte
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
== '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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue