Jump to content

String comparison: Difference between revisions

Add Racket entry
m (promoted to task)
(Add Racket entry)
Line 260:
5.0 is equal to 5
5.0 has negated object identity with 5</pre>
 
=={{header|Racket}}==
 
<lang racket>
#lang racket
 
;; Comparing two strings for exact equality
(string=? "foo" "foo")
 
;; Comparing two strings for inequality
(not (string=? "foo" "bar"))
 
;; Comparing two strings to see if one is lexically ordered before than the other
(string<? "abc" "def")
 
;; Comparing two strings to see if one is lexically ordered after than the other
(string>? "def" "abc")
 
;; How to achieve both case sensitive comparisons and case insensitive comparisons within the language
(string-ci=? "foo" "FOO")
</lang>
 
=={{header|REXX}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.