Logo

Programming-Idioms

  • Ada
  • C

Idiom #320 Test if string is empty

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

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

C23 bool
(def b (nil? s))

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