How to check if an std::wstring
is null or empty?
wstring
is not a pointer, it cannot be null. You can check if it's empty (that is, is equivalent to ""
) either by direct comparison to the previous, or by:
str.empty(); // == (str.size() == 0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With