Re: [Vala] How to check if string is empty



As Guillaume wrote, you have to use string? str and check string==null
FIRST.

But I think str.length==0 and str=="" are no high performance solutions,
especially for big/long strings.

Maybe this is better?

bool is_null_or_empty (string? str)
{
   return str == null || str[0] == '\0';
}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]