var.isString

bool isString() @property const nothrow @nogc pure @safe

Check if this value is a string (Type.STRING).

More readable alternative to v.type == var.Type.STRING.

Returns

true if the value is a string, false otherwise.

Examples

var s = "hello";
assert(s.isString);
var i = 42;
assert(!i.isString);