all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
23
Task/String-comparison/NetRexx/string-comparison.netrexx
Normal file
23
Task/String-comparison/NetRexx/string-comparison.netrexx
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
animal = 'dog'
|
||||
if animal = 'cat' then
|
||||
say animal "is lexically equal to cat"
|
||||
if animal \= 'cat' then
|
||||
say animal "is not lexically equal cat"
|
||||
if animal > 'cat' then
|
||||
say animal "is lexically higher than cat"
|
||||
if animal < 'cat' then
|
||||
say animal "is lexically lower than cat"
|
||||
if animal >= 'cat' then
|
||||
say animal "is not lexically lower than cat"
|
||||
if animal <= 'cat' then
|
||||
say animal "is not lexically higher than cat"
|
||||
/* The above comparative operators do not consider
|
||||
leading and trailing whitespace when making comparisons. */
|
||||
if ' cat ' = 'cat' then
|
||||
say "this will print because whitespace is stripped"
|
||||
|
||||
/* To consider all whitespace in a comparison
|
||||
we need to use strict comparative operators */
|
||||
|
||||
if ' cat ' == 'cat' then
|
||||
say "this will not print because comparison is strict"
|
||||
Loading…
Add table
Add a link
Reference in a new issue