D

D言語での空文字列チェック

void main (char[][] args) { char[] s; writefln(s ? "not empty" : "empty"); //=> empty writefln(s.length ? "not empty" : "empty"); //=> empty s = ""; writefln(s ? "not empty" : "empty"); //=> not empty writefln(s.length ? "not empty" : "emp…