Compare a list of strings: Difference between revisions

→‎{{header|Ring}}: remove off-topic code that compares single strings, not lists of strings
(→‎{{header|Java}}: fix equals check)
(→‎{{header|Ring}}: remove off-topic code that compares single strings, not lists of strings)
Line 2,548:
return 1 /*indicate strings have true comparison*/</lang>
{{out|output|text=&nbsp; is identical to the above REXX version.}} <br><br>
 
=={{header|Ring}}==
<lang ring>
cString1 = "hello"
cString2 = "hello"
compare(cString1,cString2)
cString1 = "abc"
cString2 = "bcd"
compare(cString1,cString2)
cString1 = "bcd"
cString2 = "abc"
compare(cString1,cString2)
 
func compare aString, bString
n = strcmp(aString,bString)
if n = 0 see aString + " = " + bString + nl
but n < 0 see aString + " < " + bString + nl
but n > 0 see aString + " > " + bString + nl ok
</lang>
 
=={{header|Ruby}}==