March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
14
Task/String-comparison/Icon/string-comparison.icon
Normal file
14
Task/String-comparison/Icon/string-comparison.icon
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
procedure main(A)
|
||||
s1 := A[1] | "a"
|
||||
s2 := A[2] | "b"
|
||||
# These first four are case-sensitive
|
||||
s1 == s2 # Are they equal?
|
||||
s1 ~== s2 # Are they unequal?
|
||||
s1 << s2 # Does s1 come before s2?
|
||||
s1 >> s2 # Does s1 come after s2?
|
||||
map(s1) == map(s2) # Caseless comparison
|
||||
"123" >> "12" # Lexical comparison
|
||||
"123" > "12" # Numeric comparison
|
||||
"123" >> 12 # Lexical comparison (12 coerced into "12")
|
||||
"123" > 12 # Numeric comparison ("123" coerced into 123)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue