Empty string: Difference between revisions
Adds slope example
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(Adds slope example) |
||
Line 2,913:
s ~~ /./s;
s !~ /^\z/;</syntaxhighlight>
=={{header|Slope}}==
<syntaxhighlight lang="slope">
(define test-string-1 "")
(define test-string-2 "Not empty")
(define empty-string? (lambda (x)
(and (string? x) (zero? (length x)))))
(empty-string? test-string-1) ; #t
(empty-string? test-string-2) ; #f
</syntaxhighlight>
=={{header|Smalltalk}}==
|