String comparison: Difference between revisions

Content added Content deleted
(Added Quackery.)
Line 2,983: Line 2,983:
<pre>/O> ( compare two strings for equality )
<pre>/O> ( compare two strings for equality )
... $ "abc" $ "xyz" =
... $ "abc" $ "xyz" =
... echo ( 0 = true, 1 = false )
... echo ( 0 = false, 1 = true )
...
...
0
0
Line 2,990: Line 2,990:
/O> ( compare two strings for inequality )
/O> ( compare two strings for inequality )
... $ "abc" $ "xyz" !=
... $ "abc" $ "xyz" !=
... echo ( 0 = true, 1 = false )
... echo ( 0 = false, 1 = true )
...
...
1
1
Line 2,997: Line 2,997:
//O> ( compare two strings to see if one is lexically ordered before the other )
//O> ( compare two strings to see if one is lexically ordered before the other )
... $ "abc" $ "xyz" $<
... $ "abc" $ "xyz" $<
... echo ( 0 = true, 1 = false )
... echo ( 0 = false, 1 = true )
...
...
1
1
Line 3,004: Line 3,004:
/O> ( compare two strings to see if one is lexically ordered after the other )
/O> ( compare two strings to see if one is lexically ordered after the other )
... $ "abc" $ "xyz" swap $>
... $ "abc" $ "xyz" swap $>
... echo ( 0 = true, 1 = false )
... echo ( 0 = false, 1 = true )
...
...
1
1
Line 3,012: Line 3,012:
... [ $ "" swap witheach [ upper join ] ] is upper$ ( $ --> $ )
... [ $ "" swap witheach [ upper join ] ] is upper$ ( $ --> $ )
... $ "AbC" upper$ $ "aBc" upper$ =
... $ "AbC" upper$ $ "aBc" upper$ =
... echo ( 0 = true, 1 = false )
... echo ( 0 = false, 1 = true )
...
...
1
1