Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/String-comparison/Picat/string-comparison.picat
Normal file
13
Task/String-comparison/Picat/string-comparison.picat
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
main =>
|
||||
S1 = "abc",
|
||||
S2 = "def",
|
||||
S1 == S2, % -> false.
|
||||
S1 != S2, % -> true.
|
||||
S1 @< S2, % -> true. Is S1 lexicographically less than S1?
|
||||
S1 @> S2, % -> false.
|
||||
to_lowercase(S1) == to_lowercase(S2), % -> false.
|
||||
|
||||
"1234" @> "123", % -> true. lexical comparison
|
||||
"1234" @< 12342222, % -> false. No coersion is done. Numbers are always ordered before strings
|
||||
|
||||
123 < 1234. % -> true '<' is used only for numbers
|
||||
Loading…
Add table
Add a link
Reference in a new issue