June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
18
Task/String-comparison/Factor/string-comparison.factor
Normal file
18
Task/String-comparison/Factor/string-comparison.factor
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
USING: ascii math.order sorting.human ;
|
||||
|
||||
IN: scratchpad "foo" "bar" = . ! compare for equality
|
||||
f
|
||||
IN: scratchpad "foo" "bar" = not . ! compare for inequality
|
||||
t
|
||||
IN: scratchpad "foo" "bar" before? . ! lexically ordered before?
|
||||
f
|
||||
IN: scratchpad "foo" "bar" after? . ! lexically ordered after?
|
||||
t
|
||||
IN: scratchpad "Foo" "foo" <=> . ! case-sensitive comparison
|
||||
+lt+
|
||||
IN: scratchpad "Foo" "foo" [ >lower ] bi@ <=> . ! case-insensitive comparison
|
||||
+eq+
|
||||
IN: scratchpad "a1" "a03" <=> . ! comparing numeric strings
|
||||
+gt+
|
||||
IN: scratchpad "a1" "a03" human<=> . ! comparing numeric strings like a human
|
||||
+lt+
|
||||
Loading…
Add table
Add a link
Reference in a new issue