Does D have an equivalent to C#'s String.IsNullOrWhiteSpace?

bauss jj_1337 at live.dk
Fri Oct 13 07:36:28 UTC 2017


On Thursday, 12 October 2017 at 18:17:54 UTC, Adam D. Ruppe wrote:
> On Thursday, 12 October 2017 at 18:11:55 UTC, Nieto wrote:
>> Does D have an equivalent to C#'s String.IsNullOrWhiteSpace() 
>> in the standard library?
>
> import std.string;
>
> if(str.strip().length == 0) {
>   // is null, empty, or all whitespace
> }

Or this:
if(!str.strip()) {
   // is null, empty, or all whitespace
}



More information about the Digitalmars-d-learn mailing list