Logo

Programming-Idioms

  • Lisp
  • Pascal

Idiom #320 Test if string is empty

Set b to true if the string s is empty, false otherwise

b := (s = '');

The brackets are optional.
#include <string.h>
bool b = !strlen(s);

C23 bool

New implementation...
< >
programming-idioms.org