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

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

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