Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #320 Test if string is empty

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

b = s.empty?
(def b (nil? s))
b = s.empty();
var b = string.IsNullOrEmpty(s);
final b = s.isEmpty;
b := s == ""
boolean b = s.equals("");
b := (s = '');
use strict;
my $b = $s eq '';
b = s == ''
b = s.is_empty()

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