Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
35
Task/String-comparison/SNOBOL4/string-comparison.sno
Normal file
35
Task/String-comparison/SNOBOL4/string-comparison.sno
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
s1 = 'mnopqrs'
|
||||
s2 = 'mnopqrs'
|
||||
s3 = 'mnopqr'
|
||||
s4 = 'nop'
|
||||
s5 = 'nOp'
|
||||
|
||||
OUTPUT = 'Case sensitive comparisons:'
|
||||
OUTPUT = LEQ(s1, s2) s1 ' and ' s2 ' are equal (LEQ).'
|
||||
OUTPUT = IDENT(s1, s2) s1 ' and ' s2 ' are equal (IDENT).'
|
||||
|
||||
OUTPUT =
|
||||
OUTPUT = LNE(s1, s3) s1 ' and ' s3 ' are not equal (LNE).'
|
||||
OUTPUT = ~LEQ(s1, s3) s1 ' and ' s3 ' are not equal (~LEQ).'
|
||||
OUTPUT = DIFFER(s1, s3) s1 ' and ' s3 ' are not equal (DIFFER).'
|
||||
|
||||
OUTPUT =
|
||||
OUTPUT = LGE(s1, s3) s1 ' is greater than or equal to ' s3 ' (LGE).'
|
||||
OUTPUT = LLE(s3, s1) s3 ' is less than or equal to ' s1 ' (LLE).'
|
||||
|
||||
OUTPUT =
|
||||
OUTPUT = LGT(s4, s1) s4 ' is greater than ' s1 ' (LGT).'
|
||||
OUTPUT = LLT(s1, s4) s1 ' is less than ' s4 ' (LLT).'
|
||||
|
||||
OUTPUT =
|
||||
OUTPUT = "Case insensitive comparison:"
|
||||
OUTPUT = LEQ(s4, REPLACE(s5, &UCASE, &LCASE)) s4 ' and ' s5 ' are equal.'
|
||||
|
||||
OUTPUT =
|
||||
OUTPUT = 'String and numeric conversions and comparisons:'
|
||||
OUTPUT = EQ('1234', 1234) '"1234" and 1234 are equal (coerce to integer).'
|
||||
OUTPUT = LEQ('1234', 1234) '"1234" and 1234 are equal (coerce to string).'
|
||||
OUTPUT =
|
||||
OUTPUT = GT('1234', 1233) '"1234" is greater than 1233 (numeric comparison).'
|
||||
OUTPUT = LT('1233', 1234) '"1233" is less than 1234 (numeric comparison).'
|
||||
END
|
||||
Loading…
Add table
Add a link
Reference in a new issue