Logo

Programming-Idioms

History of Idiom 110 > diff from v63 to v64

Edit summary for version 64 by srcreigh:
New Scheme implementation by user [srcreigh]

Version 63

2021-03-04, 08:22:57

Version 64

2021-08-15, 23:40:11

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Code
(define (empty-string? s)
  (= (string-length s) 0))

(define blank (empty-string? (string-trim s)))